Class GroupParser
- java.lang.Object
-
- antlr.Parser
-
- antlr.LLkParser
-
- org.antlr.stringtemplate.language.GroupParser
-
- All Implemented Interfaces:
GroupParserTokenTypes
public class GroupParser extends antlr.LLkParser implements GroupParserTokenTypes
Match a group of template definitions beginning with a group name declaration. Templates are enclosed in double-quotes or <<...>> quotes for multi-line templates. Template names have arg lists that indicate the cardinality of the attribute: present, optional, zero-or-more, one-or-more. Here is a sample group file: group nfa; // an NFA has edges and states nfa(states,edges) ::= << digraph NFA { rankdir=LR;} >> state(name) ::= "node [shape = circle]; ;"
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String[]_tokenNamesstatic antlr.collections.impl.BitSet_tokenSet_0static antlr.collections.impl.BitSet_tokenSet_1static antlr.collections.impl.BitSet_tokenSet_2static antlr.collections.impl.BitSet_tokenSet_3static antlr.collections.impl.BitSet_tokenSet_4static antlr.collections.impl.BitSet_tokenSet_5protected StringTemplateGroupgroup-
Fields inherited from class antlr.Parser
astFactory, inputState, returnAST, tokenNames, tokenTypeToASTClassMap, traceDepth
-
Fields inherited from interface org.antlr.stringtemplate.language.GroupParserTokenTypes
ANONYMOUS_TEMPLATE, ASSIGN, AT, BIGSTRING, COLON, COMMA, DEFINED_TO_BE, DOT, EOF, ID, LBRACK, LITERAL_default, LITERAL_group, LITERAL_implements, LPAREN, ML_COMMENT, NULL_TREE_LOOKAHEAD, OPTIONAL, PLUS, RBRACK, RPAREN, SEMI, SL_COMMENT, STAR, STRING, WS
-
-
Constructor Summary
Constructors Modifier Constructor Description GroupParser(antlr.ParserSharedInputState state)GroupParser(antlr.TokenBuffer tokenBuf)protectedGroupParser(antlr.TokenBuffer tokenBuf, int k)GroupParser(antlr.TokenStream lexer)protectedGroupParser(antlr.TokenStream lexer, int k)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidarg(StringTemplate st)voidargs(StringTemplate st)voiddefaultValuePair(java.util.Map mapping)voidgroup(StringTemplateGroup g)StringTemplatekeyValue()voidkeyValuePair(java.util.Map mapping)java.util.Mapmap()voidmapdef(StringTemplateGroup g)voidmapPairs(java.util.Map mapping)voidreportError(antlr.RecognitionException e)voidtemplate(StringTemplateGroup g)-
Methods inherited from class antlr.Parser
addMessageListener, addParserListener, addParserMatchListener, addParserTokenListener, addSemanticPredicateListener, addSyntacticPredicateListener, addTraceListener, consumeUntil, consumeUntil, defaultDebuggingSetup, getAST, getASTFactory, getFilename, getInputState, getTokenName, getTokenNames, getTokenTypeToASTClassMap, isDebugMode, mark, match, match, matchNot, panic, recover, removeMessageListener, removeParserListener, removeParserMatchListener, removeParserTokenListener, removeSemanticPredicateListener, removeSyntacticPredicateListener, removeTraceListener, reportError, reportWarning, rewind, setASTFactory, setASTNodeClass, setASTNodeType, setDebugMode, setFilename, setIgnoreInvalidDebugCalls, setInputState, setTokenBuffer, traceIndent
-
-
-
-
Field Detail
-
group
protected StringTemplateGroup group
-
_tokenNames
public static final java.lang.String[] _tokenNames
-
_tokenSet_0
public static final antlr.collections.impl.BitSet _tokenSet_0
-
_tokenSet_1
public static final antlr.collections.impl.BitSet _tokenSet_1
-
_tokenSet_2
public static final antlr.collections.impl.BitSet _tokenSet_2
-
_tokenSet_3
public static final antlr.collections.impl.BitSet _tokenSet_3
-
_tokenSet_4
public static final antlr.collections.impl.BitSet _tokenSet_4
-
_tokenSet_5
public static final antlr.collections.impl.BitSet _tokenSet_5
-
-
Constructor Detail
-
GroupParser
protected GroupParser(antlr.TokenBuffer tokenBuf, int k)
-
GroupParser
public GroupParser(antlr.TokenBuffer tokenBuf)
-
GroupParser
protected GroupParser(antlr.TokenStream lexer, int k)
-
GroupParser
public GroupParser(antlr.TokenStream lexer)
-
GroupParser
public GroupParser(antlr.ParserSharedInputState state)
-
-
Method Detail
-
reportError
public void reportError(antlr.RecognitionException e)
- Overrides:
reportErrorin classantlr.Parser
-
group
public final void group(StringTemplateGroup g) throws antlr.RecognitionException, antlr.TokenStreamException
- Throws:
antlr.RecognitionExceptionantlr.TokenStreamException
-
template
public final void template(StringTemplateGroup g) throws antlr.RecognitionException, antlr.TokenStreamException
- Throws:
antlr.RecognitionExceptionantlr.TokenStreamException
-
mapdef
public final void mapdef(StringTemplateGroup g) throws antlr.RecognitionException, antlr.TokenStreamException
- Throws:
antlr.RecognitionExceptionantlr.TokenStreamException
-
args
public final void args(StringTemplate st) throws antlr.RecognitionException, antlr.TokenStreamException
- Throws:
antlr.RecognitionExceptionantlr.TokenStreamException
-
arg
public final void arg(StringTemplate st) throws antlr.RecognitionException, antlr.TokenStreamException
- Throws:
antlr.RecognitionExceptionantlr.TokenStreamException
-
map
public final java.util.Map map() throws antlr.RecognitionException, antlr.TokenStreamException- Throws:
antlr.RecognitionExceptionantlr.TokenStreamException
-
mapPairs
public final void mapPairs(java.util.Map mapping) throws antlr.RecognitionException, antlr.TokenStreamException- Throws:
antlr.RecognitionExceptionantlr.TokenStreamException
-
keyValuePair
public final void keyValuePair(java.util.Map mapping) throws antlr.RecognitionException, antlr.TokenStreamException- Throws:
antlr.RecognitionExceptionantlr.TokenStreamException
-
defaultValuePair
public final void defaultValuePair(java.util.Map mapping) throws antlr.RecognitionException, antlr.TokenStreamException- Throws:
antlr.RecognitionExceptionantlr.TokenStreamException
-
keyValue
public final StringTemplate keyValue() throws antlr.RecognitionException, antlr.TokenStreamException
- Throws:
antlr.RecognitionExceptionantlr.TokenStreamException
-
-