Class ProtobufParser
- java.lang.Object
-
- de.haumacher.msgbuf.generator.parser.ProtobufParser
-
- All Implemented Interfaces:
ProtobufParserConstants
public class ProtobufParser extends Object implements ProtobufParserConstants
Parser for protobuf definition files..
-
-
Field Summary
Fields Modifier and Type Field Description Tokenjj_ntNext token.TokentokenCurrent token.ProtobufParserTokenManagertoken_sourceGenerated Token Manager.-
Fields inherited from interface de.haumacher.msgbuf.generator.parser.ProtobufParserConstants
ABSTRACT, BLOCK_COMMENT, BOOLEAN_TYPE, CR, DEFAULT, DOC_COMMENT, ENUM, EOF, EXTENDS, FALSE, INT, INT_TYPE, LINE_COMMENT, LONG_TYPE, MAP, MAX, MESSAGE, NAME, NL, NULL, NUMBER, ONEOF, OPTION, PACKAGE, QUOTE, REPEATED, RESERVED, SPACE, STRING, SYNTAX, TAB, TO, tokenImage, TRANSIENT, TRUE, TYPE, XNAME
-
-
Constructor Summary
Constructors Constructor Description ProtobufParser(ProtobufParserTokenManager tm)Constructor with generated Token Manager.ProtobufParser(InputStream stream)Constructor with InputStream.ProtobufParser(InputStream stream, String encoding)Constructor with InputStream and supplied encodingProtobufParser(Reader stream)Constructor.
-
Method Summary
-
-
-
Field Detail
-
token_source
public ProtobufParserTokenManager token_source
Generated Token Manager.
-
token
public Token token
Current token.
-
jj_nt
public Token jj_nt
Next token.
-
-
Constructor Detail
-
ProtobufParser
public ProtobufParser(InputStream stream)
Constructor with InputStream.
-
ProtobufParser
public ProtobufParser(InputStream stream, String encoding)
Constructor with InputStream and supplied encoding
-
ProtobufParser
public ProtobufParser(Reader stream)
Constructor.
-
ProtobufParser
public ProtobufParser(ProtobufParserTokenManager tm)
Constructor with generated Token Manager.
-
-
Method Detail
-
file
public final DefinitionFile file() throws ParseException
- Throws:
ParseException
-
optionStatement
public final void optionStatement(WithOptions part) throws ParseException
- Throws:
ParseException
-
optionAssignment
public final void optionAssignment(WithOptions part) throws ParseException
- Throws:
ParseException
-
value
public final Option value() throws ParseException
- Throws:
ParseException
-
definition
public final Definition definition() throws ParseException
- Throws:
ParseException
-
memberDefinition
public final DefinitionBase memberDefinition() throws ParseException
- Throws:
ParseException
-
enumeration
public final EnumDef enumeration() throws ParseException
- Throws:
ParseException
-
constant
public final Constant constant() throws ParseException
- Throws:
ParseException
-
message
public final MessageDef message() throws ParseException
- Throws:
ParseException
-
field
public final Field field() throws ParseException
- Throws:
ParseException
-
javaAnnotations
public final WithOptions javaAnnotations() throws ParseException
- Throws:
ParseException
-
javaAnnotationsFor
public final WithOptions javaAnnotationsFor(WithOptions result) throws ParseException
- Throws:
ParseException
-
partOptions
public final void partOptions(Part part) throws ParseException
- Throws:
ParseException
-
reserved
public final void reserved() throws ParseException- Throws:
ParseException
-
reservation
public final void reservation() throws ParseException- Throws:
ParseException
-
oneof
public final void oneof() throws ParseException- Throws:
ParseException
-
type
public final Type type() throws ParseException
- Throws:
ParseException
-
primitiveType
public final PrimitiveType primitiveType() throws ParseException
- Throws:
ParseException
-
customType
public final CustomType customType() throws ParseException
- Throws:
ParseException
-
map
public final MapType map() throws ParseException
- Throws:
ParseException
-
qName
public final QName qName() throws ParseException
- Throws:
ParseException
-
name
public final String name() throws ParseException
- Throws:
ParseException
-
ReInit
public void ReInit(InputStream stream)
Reinitialise.
-
ReInit
public void ReInit(InputStream stream, String encoding)
Reinitialise.
-
ReInit
public void ReInit(Reader stream)
Reinitialise.
-
ReInit
public void ReInit(ProtobufParserTokenManager tm)
Reinitialise.
-
getNextToken
public final Token getNextToken()
Get the next Token.
-
getToken
public final Token getToken(int index)
Get the specific Token.
-
generateParseException
public ParseException generateParseException()
Generate ParseException.
-
trace_enabled
public final boolean trace_enabled()
Trace enabled.
-
enable_tracing
public final void enable_tracing()
Enable tracing.
-
disable_tracing
public final void disable_tracing()
Disable tracing.
-
-