-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* cleanup unit tests
- Loading branch information
Showing
8 changed files
with
370 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
qualifiedTableName = name indexOpt | ||
{ | ||
// now stack contains 3 `NSString`s. | ||
// ["mydb", "mytable", "foo"] | ||
// NSString *indexName = POP(); | ||
// NSString *tableName = POP(); | ||
// NSString *dbName = POP(); | ||
// do stuff here | ||
}; | ||
|
||
databaseName = Word; | ||
tableName = Word; | ||
indexName = QuotedString; | ||
|
||
name = (databaseName '.'!)? tableName | ||
{ | ||
// now stack contains 2 `PKToken`s of type Word | ||
// [<Word «mydb»>, <Word «mytable»>] | ||
// pop their string values | ||
NSString *tableName = POP_STR(); | ||
NSString *dbName = POP_STR(); | ||
PUSH(dbName); | ||
PUSH(tableName); | ||
}; | ||
|
||
indexOpt | ||
= index | ||
| Empty { PUSH(@""); } | ||
; | ||
|
||
index | ||
= ('INDEXED'! 'BY'! indexName) | ||
{ | ||
// now top of stack will be a Quoted String `PKToken` | ||
// […, <Quoted String «"foo"»>] | ||
// pop its string value | ||
NSString *indexName = POP_STR(); | ||
// trim quotes | ||
indexName = [indexName substringWithRange:NSMakeRange(1, [indexName length]-2)]; | ||
// leave it on the stack for later | ||
PUSH(indexName); | ||
} | ||
| ('NOT'! 'INDEXED'!) { PUSH(@""); } | ||
; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#import <PEGKit/PKParser.h> | ||
|
||
enum { | ||
TABLEINDEX_TOKEN_KIND_BY = 14, | ||
TABLEINDEX_TOKEN_KIND_INDEXED, | ||
TABLEINDEX_TOKEN_KIND_NOT_UPPER, | ||
TABLEINDEX_TOKEN_KIND_DOT, | ||
}; | ||
|
||
@interface TableIndexParser : PKParser | ||
|
||
@end | ||
|
Oops, something went wrong.