We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was creating a parser:
Expression ::= (<Orientation>)? (<Superview><Connection>)? <View> (<Connection><View>)* (<Connection><Superview>)?; Connection ::= '-' | '-' 'Number' '-'; View ::= '[' 'Identifier' ']'; Superview ::= '|'; Orientation ::= 'V:' | 'H:';
I encountered error when I try to create parsers (SLR/LR1/LALR1). ("Could not insert reduce in action table for state 14, token -")
Test Case:
NSError* error; NSString* grammarPath = [[NSBundle mainBundle] pathForResource:@"VFL" ofType:@"grammar"]; NSString* grammarString = [NSString stringWithContentsOfFile:grammarPath encoding:NSUTF8StringEncoding error:&error]; CPGrammar* grammar = [[CPGrammar alloc] initWithStart:@"Expression" backusNaurForm:grammarString error:&error]; NSLog(@"grammar: %@", grammarString); CPTokeniser* tokenizer = [[CPTokeniser alloc] init]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@"V:"]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@"H:"]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@"|"]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@"-"]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@","]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@"("]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@")"]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@"["]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@"]"]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@">="]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@"<="]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@"=="]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@">"]]; [tokenizer addTokenRecogniser:[CPKeywordRecogniser recogniserForKeyword:@"<"]]; [tokenizer addTokenRecogniser:[CPIdentifierRecogniser identifierRecogniser]]; [tokenizer addTokenRecogniser:[CPNumberRecogniser numberRecogniser]]; [tokenizer addTokenRecogniser:[CPWhiteSpaceRecogniser whiteSpaceRecogniser]]; CPTokenStream* stream = [tokenizer tokenise:@"H:|-50-[label]-50-|"]; NSLog(@"stream: %@", stream); CPParser* parser = [[CPLALR1Parser alloc] initWithGrammar:grammar]; CPSyntaxTree* ast = [parser parse:stream]; NSLog(@"ast: %@", ast);
If I remove (<Connection><View>)* from the grammar it will work, I wonder can I rewrite the grammar such that I can make it work with CoreParse?
(<Connection><View>)*
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I was creating a parser:
I encountered error when I try to create parsers (SLR/LR1/LALR1). ("Could not insert reduce in action table for state 14, token -")
Test Case:
If I remove
(<Connection><View>)*
from the grammar it will work, I wonder can I rewrite the grammar such that I can make it work with CoreParse?The text was updated successfully, but these errors were encountered: