001: package persistence.antlr;
002:
003: /* ANTLR Translator Generator
004: * Project led by Terence Parr at http://www.jGuru.com
005: * Software rights: http://www.antlr.org/license.html
006: *
007: */
008:
009: import persistence.antlr.collections.impl.BitSet;
010:
011: public interface ANTLRGrammarParseBehavior {
012: public void abortGrammar();
013:
014: public void beginAlt(boolean doAST_);
015:
016: public void beginChildList();
017:
018: // Exception handling
019: public void beginExceptionGroup();
020:
021: public void beginExceptionSpec(Token label);
022:
023: public void beginSubRule(Token label, Token start, boolean not);
024:
025: // Trees
026: public void beginTree(Token tok) throws SemanticException;
027:
028: public void defineRuleName(Token r, String access, boolean ruleAST,
029: String docComment) throws SemanticException;
030:
031: public void defineToken(Token tokname, Token tokliteral);
032:
033: public void endAlt();
034:
035: public void endChildList();
036:
037: public void endExceptionGroup();
038:
039: public void endExceptionSpec();
040:
041: public void endGrammar();
042:
043: public void endOptions();
044:
045: public void endRule(String r);
046:
047: public void endSubRule();
048:
049: public void endTree();
050:
051: public void hasError();
052:
053: public void noASTSubRule();
054:
055: public void oneOrMoreSubRule();
056:
057: public void optionalSubRule();
058:
059: public void refAction(Token action);
060:
061: public void refArgAction(Token action);
062:
063: public void setUserExceptions(String thr);
064:
065: public void refCharLiteral(Token lit, Token label,
066: boolean inverted, int autoGenType, boolean lastInRule);
067:
068: public void refCharRange(Token t1, Token t2, Token label,
069: int autoGenType, boolean lastInRule);
070:
071: public void refElementOption(Token option, Token value);
072:
073: public void refTokensSpecElementOption(Token tok, Token option,
074: Token value);
075:
076: public void refExceptionHandler(Token exTypeAndName, Token action);
077:
078: public void refHeaderAction(Token name, Token act);
079:
080: public void refInitAction(Token action);
081:
082: public void refMemberAction(Token act);
083:
084: public void refPreambleAction(Token act);
085:
086: public void refReturnAction(Token returnAction);
087:
088: public void refRule(Token idAssign, Token r, Token label,
089: Token arg, int autoGenType);
090:
091: public void refSemPred(Token pred);
092:
093: public void refStringLiteral(Token lit, Token label,
094: int autoGenType, boolean lastInRule);
095:
096: public void refToken(Token assignId, Token t, Token label,
097: Token args, boolean inverted, int autoGenType,
098: boolean lastInRule);
099:
100: public void refTokenRange(Token t1, Token t2, Token label,
101: int autoGenType, boolean lastInRule);
102:
103: // Tree specifiers
104: public void refTreeSpecifier(Token treeSpec);
105:
106: public void refWildcard(Token t, Token label, int autoGenType);
107:
108: public void setArgOfRuleRef(Token argaction);
109:
110: public void setCharVocabulary(BitSet b);
111:
112: // Options
113: public void setFileOption(Token key, Token value, String filename);
114:
115: public void setGrammarOption(Token key, Token value);
116:
117: public void setRuleOption(Token key, Token value);
118:
119: public void setSubruleOption(Token key, Token value);
120:
121: public void startLexer(String file, Token name, String super Class,
122: String doc);
123:
124: // Flow control for grammars
125: public void startParser(String file, Token name, String super Class,
126: String doc);
127:
128: public void startTreeWalker(String file, Token name,
129: String super Class, String doc);
130:
131: public void synPred();
132:
133: public void zeroOrMoreSubRule();
134: }
|