|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--parser.ExpressionParser
A parser, generated by notavaCC 0.63.
parseRoot(java.io.File)
parses a text and generates an abstruct syntax tree.
Nodes of the tree is sub-types of ExpressionParser.Node
.
The class and any nested classes in the class are not synchronized.
Nested Class Summary | |
static interface |
ExpressionParser.Addition
The node Addition . |
static interface |
ExpressionParser.Default
A namespace for the default implementations of the user-defined types. |
static interface |
ExpressionParser.Division
The node Division . |
static interface |
ExpressionParser.Expression
The node Expression . |
static class |
ExpressionParser.LexicalAnalizer
Generates a sequence of tokens. |
static interface |
ExpressionParser.Multiplication
The node Multiplication . |
static interface |
ExpressionParser.Node
A node of the abstract syntax tree that is the result of parsing. |
protected static class |
ExpressionParser.NodeInitializationParameters
Contains non-public fields to create a node. |
static interface |
ExpressionParser.Number
The node Number . |
static class |
ExpressionParser.ParseException
Describes a error of a parsing. |
static interface |
ExpressionParser.Root
The node Root . |
static interface |
ExpressionParser.Subtraction
The node Subtraction . |
static interface |
ExpressionParser.Token
A token, which is a part of a parsed text. |
static class |
ExpressionParser.Visitor
A visitor of the visitor design pattern. |
Field Summary | |
static int |
TOKEN_END_OF_LINE_COMMENT
Describes the terminal END_OF_LINE_COMMENT. |
static int |
TOKEN_INTEGER
Describes the terminal INTEGER. |
static int |
TOKEN_TRADITIONAL_COMMENT
Describes the terminal TRADITIONAL_COMMENT. |
static int |
TOKEN_WHITE_SPACES
Describes the terminal WHITE_SPACES. |
Constructor Summary | |
ExpressionParser()
|
Method Summary | |
protected ExpressionParser.Node |
createNode(int symbolID,
ExpressionParser.NodeInitializationParameters parameters)
Creates a node. |
protected ExpressionParser.Node |
createNode(int symbolID,
ExpressionParser.NodeInitializationParameters parameters,
boolean compact)
Creates a node. |
static java.lang.CharSequence |
getCharSequence(java.io.File file)
|
ExpressionParser.Root |
parseRoot(ExpressionParser.LexicalAnalizer analizer)
parses a Root . |
ExpressionParser.Root |
parseRoot(java.io.File file)
parses a Root . |
ExpressionParser.Root |
parseRoot(java.lang.String sourceName,
java.lang.CharSequence seq,
int tabStop)
parses a Root . |
ExpressionParser.Root |
parseRoot(java.lang.String sourceName,
java.io.File file,
int tabStop)
parses a Root . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int TOKEN_WHITE_SPACES
public static final int TOKEN_TRADITIONAL_COMMENT
public static final int TOKEN_END_OF_LINE_COMMENT
public static final int TOKEN_INTEGER
Constructor Detail |
public ExpressionParser()
Method Detail |
protected ExpressionParser.Node createNode(int symbolID, ExpressionParser.NodeInitializationParameters parameters) throws ExpressionParser.ParseException
The type of the node to create is described by symbolID
as follows.
symbolID | type to create |
---|---|
Root.ID |
ExpressionParser.Root |
Addition.ID |
ExpressionParser.Addition |
Subtraction.ID |
ExpressionParser.Subtraction |
Multiplication.ID |
ExpressionParser.Multiplication |
Division.ID |
ExpressionParser.Division |
Number.ID |
ExpressionParser.Number |
The implementation by the ExpressionParser
is equivalent to createNode(symbolID, parameters, false)
.
symbolID
- the kind of the node to create.parameters
- the parameters to initialize the node.
ExpressionParser.ParseException
protected final ExpressionParser.Node createNode(int symbolID, ExpressionParser.NodeInitializationParameters parameters, boolean compact)
ExpressionParser.Default
.
symbolID
- the kind of the node to create. See createNode(int, ExpressionParser.NodeInitializationParameters)
.parameters
- the parameters to initialize the node.compact
- create a compact node, which have only labeled children.
public ExpressionParser.Root parseRoot(java.io.File file) throws java.io.IOException, ExpressionParser.ParseException
Root
.
java.io.IOException
ExpressionParser.ParseException
public ExpressionParser.Root parseRoot(java.lang.String sourceName, java.io.File file, int tabStop) throws java.io.IOException, ExpressionParser.ParseException
Root
.
java.io.IOException
ExpressionParser.ParseException
public ExpressionParser.Root parseRoot(java.lang.String sourceName, java.lang.CharSequence seq, int tabStop) throws ExpressionParser.ParseException
Root
.
ExpressionParser.ParseException
public ExpressionParser.Root parseRoot(ExpressionParser.LexicalAnalizer analizer) throws ExpressionParser.ParseException
Root
.
ExpressionParser.ParseException
public static java.lang.CharSequence getCharSequence(java.io.File file) throws java.io.IOException, ExpressionParser.ParseException
java.io.IOException
ExpressionParser.ParseException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |