Package org.antlr.tool
Class GrammarSerializerFoo
java.lang.Object
org.antlr.tool.GrammarSerializerFoo
Serialize a grammar into a highly compressed form with
only the info needed to recognize sentences.
FORMAT:
file ::= $ANTLR<version:byte><grammartype:byte><name:string>;<numRules:short>
rule ::= R<rulename:string>;B<nalts:short>.
alt ::= A;
elem ::= t<tokentype:short> | r<ruleIndex:short> | -<char:uchar><char:uchar> | ~ | w
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ByteArrayOutputStream
protected String
protected Grammar
protected int
protected DataOutputStream
protected Stack
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
alt
(GrammarAST alt) void
block
(int nalts) void
void
close()
void
endAlt()
void
endRule()
void
void
not()
void
void
range()
void
void
void
token
(GrammarAST t) void
void
writeString
(DataOutputStream out, String s)
-
Field Details
-
out
-
filename
-
g
-
streams
-
altBuf
-
numElementsInAlt
protected int numElementsInAlt
-
-
Constructor Details
-
GrammarSerializerFoo
-
-
Method Details
-
open
- Throws:
IOException
-
close
- Throws:
IOException
-
grammar
-
rule
-
endRule
public void endRule() -
block
public void block(int nalts) -
alt
-
endAlt
public void endAlt() -
ruleRef
-
token
-
charLiteral
-
wildcard
-
range
public void range() -
not
public void not() -
writeString
- Throws:
IOException
-