|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--fri.patterns.interpreter.parsergenerator.syntax.builder.SyntaxSeparation
Separates lexer from parser rules. Provides token and ignored symbols after construction, which can be used for LexerBuilder construction.
Example:
SyntaxSeparation separation = new SyntaxSeparation(new Syntax(myRules));
LexerBuilder builder = new LexerBuilder(separation.getLexerSyntax(), separation.getIgnoredSymbols());
Lexer lexer = builder.getLexer();
// when using the lexer standalone, you must put the token terminal symbols into it now:
lexer.setTerminals(separation.getTokenSymbols());
// when using a Parser the Parser will do this:
LexerBuilder| Nested Class Summary | |
static class |
SyntaxSeparation.IntArray
|
| Field Summary | |
static boolean |
DEBUG
|
| Constructor Summary | |
SyntaxSeparation(Syntax syntax)
Splits a syntax into two syntaxes containing parser and lexer rules, tokens and ignored get collected. |
|
| Method Summary | |
java.util.List |
getIgnoredSymbols()
Returns the top level ignored token symbols for the lexer. |
Syntax |
getLexerSyntax()
Returns the lexer syntax that remains after removing all parser rules and token/ignored directives. |
Syntax |
getParserSyntax()
Returns the parser syntax that remains after removing all lexer rules. |
java.util.List |
getTokenSymbols()
Returns the top level token symbols for the lexer. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static boolean DEBUG
| Constructor Detail |
public SyntaxSeparation(Syntax syntax)
throws SyntaxException
| Method Detail |
public Syntax getLexerSyntax()
public Syntax getParserSyntax()
public java.util.List getTokenSymbols()
public java.util.List getIgnoredSymbols()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||