
Hi,
in the Lexer I defined a DynamicalLexicalPatternGroup with Explicit Patterns:
DynamicLexicalPatternGroup lexicalPatternGroup = new DynamicLexicalPatternGroup(DynamicLexicalPatternType.Explicit, "GopMenge", classificationTypeProvider.GOP);
lexicalPatternGroup.TokenId = MyTokenId.MySpecialToken;
lexicalPatternGroup.LookAheadPattern = "[,|+]|{LineTerminator}";
lexicalPatternGroup.Patterns.Add(new DynamicLexicalPattern("11301"));
lexicalPatternGroup.Patterns.Add(new DynamicLexicalPattern("22301"));
lexicalPatternGroup.Patterns.Add(new DynamicLexicalPattern("35301"));
lexicalPatternGroup.Patterns.Add(new DynamicLexicalPattern("35301A"));
lexicalPatternGroup.Patterns.Add(new DynamicLexicalPattern("35301B"));
lexicalState.LexicalPatternGroups.Add(lexicalPatternGroup);
Text in the editor:
"11301, 22301": all tokens are recognized perfectly
Requirement: Token should be recognized as well with using regexp or wildcard in the editor
Text in editor:
"..301", 35301*: both should be reognized as a valid "MySpecialToken"
Each '.' is a placeholder for a digit, and '*' is a placeholder for all letters after the number.
I use the LLParser Framework, with GrammarClass providing AST Nodes.
My question:
Where in this framework with parser, lexer, tokenreader, etc. can I implement a special "IsValid"-method
perhaps before or after the lexer, parser or tokenreader compare the strings with the explicit patterns and states a "does not fit"?
Looking forward to your ideas!