|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectkoala.dynamicjava.parser.impl.Parser
public class Parser
This class represents a (interpreted) Java 1.1 language parser adapted for 1.5 language extensions.
| Nested Class Summary | |
|---|---|
static class |
Parser.DeclType
|
| Field Summary | |
|---|---|
Token |
jj_nt
|
boolean |
lookingAhead
|
Token |
token
|
ParserTokenManager |
token_source
|
| Constructor Summary | |
|---|---|
Parser(java.io.InputStream stream)
|
|
Parser(java.io.InputStream stream,
java.lang.String encoding)
|
|
Parser(ParserTokenManager tm)
|
|
Parser(java.io.Reader stream)
|
|
| Method Summary | |
|---|---|
Expression |
additiveExpression()
Used internally to parse an expression |
koala.dynamicjava.parser.impl.Parser.Primary |
allocation()
Used internally to parse an expression |
Expression |
andExpression()
Used internally to parse an expression |
Annotation |
annotation()
|
ArrayInitializer |
annotationArrayValue()
|
Expression |
annotationValue()
|
java.util.List<Expression> |
arguments()
Used internally to parse an expression |
ArrayAllocation.TypeDescriptor |
arrayDimsAndInits()
Used internally to parse an expression |
ArrayInitializer |
arrayInitializer()
Parses an array initializer |
AssertStatement |
assertStatement()
Parses an assert statement |
BlockStatement |
block()
Parses a block |
java.util.List<Node> |
blockStatement()
Parses one block statement. |
BreakStatement |
breakStatement()
Parses a break statement |
Expression |
castExpression()
Used internally to parse an expression |
void |
castLookahead()
Distinguish a cast expression from a parenthesized expression. |
java.util.List<Node> |
classBody()
Used internally to parse the body of a class |
java.util.List<Node> |
classBodyDeclaration()
Parses one declaration in the body of a class. |
ClassDeclaration |
classDeclaration(Parser.DeclType level)
Parses a class declaration |
Expression |
conditionalAndExpression()
Used internally to parse an expression |
Expression |
conditionalExpression()
Used internally to parse an expression |
Expression |
conditionalOrExpression()
Used internally to parse an expression |
ConstructorDeclaration |
constructorDeclaration()
|
void |
constructorLookahead()
Distinguish an unmodified constructor declaration from other declarations. |
ContinueStatement |
continueStatement()
Parses a continue statement |
void |
disable_tracing()
|
DoStatement |
doStatement()
Parses a do statement |
EmptyStatement |
emptyStatement()
Parses an empty statement |
void |
enable_tracing()
|
EnumDeclaration.EnumBody |
enumBody()
Parses the body of an enum |
EnumDeclaration.EnumConstant |
enumConstant()
|
java.util.List<EnumDeclaration.EnumConstant> |
enumConstants()
|
EnumDeclaration |
enumDeclaration(Parser.DeclType level)
Parses an enum declaration |
Expression |
equalityExpression()
Used internally to parse an expression |
Expression |
exclusiveOrExpression()
Used internally to parse an expression |
Expression |
expression()
Parses an expression |
ExpressionStatement |
expressionStatement(boolean strictExpression)
Parses an ExpressionStatement; if strictExpression is true, a trailing semicolon is required and only StatementExpressions will be allowed. |
java.util.List<Node> |
expressionStatementList()
Parses a comma separated list of strict ExpressionStatements |
Expression |
expressionSuffix(Expression pre)
Used internally to parse an expression |
FormalParameter |
forEachParameter(ModifierSet mods)
A for-each parameter, which is more restricted than a general formal parameter (no additional array brackets, and no varargs) |
FormalParameter |
formalParameter()
Parses one formal parameter |
java.util.List<FormalParameter> |
formalParameters()
Parses formal parameters of the form '(param, param, ...)' |
ForSlashEachStatement |
forStatement()
Parses a for statement (with standard or foreach syntax) |
ParseException |
generateParseException()
|
Token |
getNextToken()
|
Token |
getToken(int index)
|
Statement |
ifStatement()
Parses an if statement |
ImportDeclaration |
importDeclaration()
|
Expression |
inclusiveOrExpression()
Used internally to parse an expression |
Initializer |
initializer()
Parses one initializer |
Expression |
instanceOfExpression()
Used internally to parse an expression |
InterfaceDeclaration |
interfaceDeclaration(Parser.DeclType level)
Parses a interface declaration |
java.util.List<Node> |
interfaceMemberDeclaration()
Parses one declaration in the body of an interface. |
Node |
keywordStatement(boolean strictExpressions)
A statement that starts with a keyword or special delimiter. |
Statement |
labeledStatement()
Parses a labeled statement |
Expression |
literal()
Used internally to parse an expression |
MethodDeclaration |
methodDeclaration(Parser.DeclType level)
|
void |
methodLookahead()
Distinguish an unmodified method declaration from other declarations. |
ModifierSet |
modifiers()
Parse a nonempty list of modifiers and annotations |
Expression |
multiplicativeExpression()
Used internally to parse an expression |
java.util.List<IdentifierToken> |
name()
Parses a name |
ModifierSet |
noModifiers()
Create an empty modifier set at the current location. |
Node |
nonKeywordStatement(boolean strictExpressions)
A statement that does not begin with a keyword (and thus may need special lookahead treatment). |
ModifierSet |
optionalModifiers()
|
Token |
optionalSemicolon()
|
Option<java.util.List<TypeName>> |
optionalTypeArguments()
|
PackageDeclaration |
packageDeclaration(Parser.DeclType level)
|
CompilationUnit |
parseCompilationUnit()
Parses a Java compilation unit |
java.util.List<Node> |
parseStream()
Parses input stream. |
Expression |
postfixExpression()
Used internally to parse an expression |
Expression |
preDecrementExpression()
Used internally to parse an expression |
Expression |
preIncrementExpression()
Used internally to parse an expression |
Expression |
primaryExpression()
Used internally to parse an expression |
koala.dynamicjava.parser.impl.Parser.Primary |
primaryPrefix()
Used internally to parse an expression |
PrimitiveTypeName |
primitiveType()
Used internally to parse types |
ReferenceTypeName |
referenceTypeName()
Consumes as large a name as possible: the type must not be followed by ".[id]" or "<", because the parser will assume those delimiters mark a continuation of the ReferenceTypeName. |
java.util.List<? extends ReferenceTypeName> |
ReferenceTypeNameList()
Parses a comma separated list of ReferenceTypeName names |
void |
ReInit(java.io.InputStream stream)
|
void |
ReInit(java.io.InputStream stream,
java.lang.String encoding)
|
void |
ReInit(ParserTokenManager tm)
|
void |
ReInit(java.io.Reader stream)
|
Expression |
relationalExpression()
Used internally to parse an expression |
java.util.List<Node> |
replStatement()
Parses an item of the input stream. |
TypeName |
resultType()
Used internally to parse types |
ReturnStatement |
returnStatement()
Parses a return statement |
Token |
RightAngledBracket()
|
void |
setFile(java.io.File f)
Sets the current file |
void |
setOptions(Options o)
|
Expression |
shiftExpression()
Used internally to parse an expression |
Node |
statement(boolean strictExpressions)
|
Expression |
statementExpression()
Parse only an expression that can appear as a statement |
SwitchBlock |
switchBlock()
|
SwitchStatement |
switchStatement()
Parses a switch statement |
SynchronizedStatement |
synchronizedStatement()
Parses a synchronized statement |
ThrowStatement |
throwStatement()
Parses a throw statement |
TryStatement |
tryStatement()
Parses a try statement |
TypeName |
type()
Used internally to parse types |
TypeName |
TypeArgument()
|
java.util.List<TypeName> |
typeArguments()
|
TypeDeclaration |
typeDeclaration(Parser.DeclType level)
|
TypeParameter |
typeParameter()
|
java.util.List<TypeParameter> |
typeParameters()
|
Expression |
unaryExpression()
Used internally to parse an expression |
Expression |
unaryExpressionNotPlusMinus()
Used internally to parse an expression |
ClassDeclaration |
unmodifiedClassDeclaration(ModifierSet mods,
Parser.DeclType level)
Parses a class declaration without modifier |
ConstructorDeclaration |
unmodifiedConstructorDeclaration(ModifierSet mods)
|
EnumDeclaration |
unmodifiedEnumDeclaration(ModifierSet mods,
Parser.DeclType level)
|
InterfaceDeclaration |
unmodifiedInterfaceDeclaration(ModifierSet mods,
Parser.DeclType level)
Parses a interface declaration without modifier |
MethodDeclaration |
unmodifiedMethodDeclaration(ModifierSet mods,
Parser.DeclType level)
|
PackageDeclaration |
unmodifiedPackageDeclaration(ModifierSet mods,
Parser.DeclType level)
|
TypeDeclaration |
unmodifiedTypeDeclaration(ModifierSet mods,
Parser.DeclType level)
|
java.util.List<Node> |
unmodifiedVariableDeclaration(ModifierSet mods,
Parser.DeclType level)
|
java.util.List<Node> |
variableDeclaration(Parser.DeclType level)
Parses a variable (field or local) declaration. |
Expression |
variableInitializer()
Parses a variable initializer (ie. |
void |
variableLookahead()
Distinguish an unmodified variable or field declaration from other declarations. |
WhileStatement |
whileStatement()
Parses a while statement |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public ParserTokenManager token_source
public Token token
public Token jj_nt
public boolean lookingAhead
| Constructor Detail |
|---|
public Parser(java.io.InputStream stream)
public Parser(java.io.InputStream stream,
java.lang.String encoding)
public Parser(java.io.Reader stream)
public Parser(ParserTokenManager tm)
| Method Detail |
|---|
public void setFile(java.io.File f)
public void setOptions(Options o)
public final java.util.List<Node> parseStream()
throws ParseException
ParseExceptionNode
public final java.util.List<Node> replStatement()
throws ParseException
ParseExceptionNode
public final CompilationUnit parseCompilationUnit()
throws ParseException
ParseExceptionNode
public final ModifierSet optionalModifiers()
throws ParseException
ParseException
public final ModifierSet noModifiers()
throws ParseException
ParseException
public final ModifierSet modifiers()
throws ParseException
ParseException
public final PackageDeclaration packageDeclaration(Parser.DeclType level)
throws ParseException
ParseException
public final PackageDeclaration unmodifiedPackageDeclaration(ModifierSet mods,
Parser.DeclType level)
throws ParseException
ParseException
public final ImportDeclaration importDeclaration()
throws ParseException
ParseException
public final TypeDeclaration typeDeclaration(Parser.DeclType level)
throws ParseException
ParseException
public final TypeDeclaration unmodifiedTypeDeclaration(ModifierSet mods,
Parser.DeclType level)
throws ParseException
ParseException
public final java.util.List<IdentifierToken> name()
throws ParseException
ParseExceptionTreeToken
public final ReferenceTypeName referenceTypeName()
throws ParseException
ParseException
public final java.util.List<? extends ReferenceTypeName> ReferenceTypeNameList()
throws ParseException
ParseExceptionReferenceTypeName
public final ClassDeclaration classDeclaration(Parser.DeclType level)
throws ParseException
ParseExceptionClassDeclaration
public final ClassDeclaration unmodifiedClassDeclaration(ModifierSet mods,
Parser.DeclType level)
throws ParseException
ParseExceptionClassDeclaration
public final java.util.List<Node> classBody()
throws ParseException
ParseException
public final java.util.List<Node> classBodyDeclaration()
throws ParseException
ParseExceptionNode
public final java.util.List<Node> variableDeclaration(Parser.DeclType level)
throws ParseException
ParseException
public final java.util.List<Node> unmodifiedVariableDeclaration(ModifierSet mods,
Parser.DeclType level)
throws ParseException
ParseException
public final MethodDeclaration methodDeclaration(Parser.DeclType level)
throws ParseException
ParseException
public final MethodDeclaration unmodifiedMethodDeclaration(ModifierSet mods,
Parser.DeclType level)
throws ParseException
ParseException
public final java.util.List<FormalParameter> formalParameters()
throws ParseException
ParseExceptionFormalParameter
public final FormalParameter formalParameter()
throws ParseException
ParseExceptionFormalParameter
public final Initializer initializer()
throws ParseException
ParseExceptionInitializer
public final ConstructorDeclaration constructorDeclaration()
throws ParseException
ParseException
public final ConstructorDeclaration unmodifiedConstructorDeclaration(ModifierSet mods)
throws ParseException
ParseException
public final InterfaceDeclaration interfaceDeclaration(Parser.DeclType level)
throws ParseException
ParseExceptionInterfaceDeclaration
public final InterfaceDeclaration unmodifiedInterfaceDeclaration(ModifierSet mods,
Parser.DeclType level)
throws ParseException
ParseExceptionInterfaceDeclaration
public final java.util.List<Node> interfaceMemberDeclaration()
throws ParseException
ParseExceptionNode
public final EnumDeclaration enumDeclaration(Parser.DeclType level)
throws ParseException
ParseExceptionEnumDeclaration
public final EnumDeclaration unmodifiedEnumDeclaration(ModifierSet mods,
Parser.DeclType level)
throws ParseException
ParseException
public final EnumDeclaration.EnumBody enumBody()
throws ParseException
ParseExceptionNode
public final java.util.List<EnumDeclaration.EnumConstant> enumConstants()
throws ParseException
ParseException
public final EnumDeclaration.EnumConstant enumConstant()
throws ParseException
ParseException
public final ArrayInitializer arrayInitializer()
throws ParseException
ParseExceptionArrayInitializer
public final Expression variableInitializer()
throws ParseException
ParseExceptionExpression
public final BlockStatement block()
throws ParseException
ParseExceptionBlockStatement
public final java.util.List<Node> blockStatement()
throws ParseException
ParseExceptionNode
public final Node statement(boolean strictExpressions)
throws ParseException
ParseException
public final Node keywordStatement(boolean strictExpressions)
throws ParseException
ParseException
public final Node nonKeywordStatement(boolean strictExpressions)
throws ParseException
ParseException
public final Statement labeledStatement()
throws ParseException
ParseExceptionContinueTarget,
LabeledStatement
public final EmptyStatement emptyStatement()
throws ParseException
ParseExceptionEmptyStatement
public final Statement ifStatement()
throws ParseException
ParseExceptionIfThenStatement,
IfThenElseStatement
public final AssertStatement assertStatement()
throws ParseException
ParseExceptionAssertStatement
public final WhileStatement whileStatement()
throws ParseException
ParseExceptionWhileStatement
public final DoStatement doStatement()
throws ParseException
ParseExceptionDoStatement
public final SwitchStatement switchStatement()
throws ParseException
ParseExceptionSwitchStatement
public final SwitchBlock switchBlock()
throws ParseException
ParseException
public final ForSlashEachStatement forStatement()
throws ParseException
ParseExceptionModified by Adam Wulf and David Peters
March 2004: Dr. Java team.,
ForSlashEachStatement,
ForEachStatement
public final FormalParameter forEachParameter(ModifierSet mods)
throws ParseException
ParseException
public final java.util.List<Node> expressionStatementList()
throws ParseException
ParseException
public final BreakStatement breakStatement()
throws ParseException
ParseExceptionBreakStatement
public final ContinueStatement continueStatement()
throws ParseException
ParseExceptionContinueStatement
public final ReturnStatement returnStatement()
throws ParseException
ParseExceptionReturnStatement
public final ThrowStatement throwStatement()
throws ParseException
ParseExceptionThrowStatement
public final SynchronizedStatement synchronizedStatement()
throws ParseException
ParseExceptionSynchronizedStatement
public final TryStatement tryStatement()
throws ParseException
ParseExceptionTryStatement
public final ExpressionStatement expressionStatement(boolean strictExpression)
throws ParseException
ParseException
public final Token optionalSemicolon()
throws ParseException
ParseException
public final Expression expression()
throws ParseException
ParseExceptionExpression
public final Expression statementExpression()
throws ParseException
ParseException
public final Expression expressionSuffix(Expression pre)
throws ParseException
ParseException
public final Expression conditionalExpression()
throws ParseException
ParseException
public final Expression conditionalOrExpression()
throws ParseException
ParseException
public final Expression conditionalAndExpression()
throws ParseException
ParseException
public final Expression inclusiveOrExpression()
throws ParseException
ParseException
public final Expression exclusiveOrExpression()
throws ParseException
ParseException
public final Expression andExpression()
throws ParseException
ParseException
public final Expression equalityExpression()
throws ParseException
ParseException
public final Expression instanceOfExpression()
throws ParseException
ParseException
public final Expression relationalExpression()
throws ParseException
ParseException
public final Expression shiftExpression()
throws ParseException
ParseException
public final Expression additiveExpression()
throws ParseException
ParseException
public final Expression multiplicativeExpression()
throws ParseException
ParseException
public final Expression unaryExpression()
throws ParseException
ParseException
public final Expression unaryExpressionNotPlusMinus()
throws ParseException
ParseException
public final Expression castExpression()
throws ParseException
ParseException
public final Expression preIncrementExpression()
throws ParseException
ParseException
public final Expression preDecrementExpression()
throws ParseException
ParseException
public final Expression postfixExpression()
throws ParseException
ParseException
public final Expression primaryExpression()
throws ParseException
ParseException
public final koala.dynamicjava.parser.impl.Parser.Primary primaryPrefix()
throws ParseException
ParseException
public final koala.dynamicjava.parser.impl.Parser.Primary allocation()
throws ParseException
ParseException
public final ArrayAllocation.TypeDescriptor arrayDimsAndInits()
throws ParseException
ParseException
public final java.util.List<Expression> arguments()
throws ParseException
ParseException
public final Expression literal()
throws ParseException
ParseException
public final TypeName type()
throws ParseException
ParseException
public final TypeName resultType()
throws ParseException
ParseException
public final PrimitiveTypeName primitiveType()
throws ParseException
ParseException
public final java.util.List<TypeParameter> typeParameters()
throws ParseException
ParseException
public final TypeParameter typeParameter()
throws ParseException
ParseException
public final Option<java.util.List<TypeName>> optionalTypeArguments()
throws ParseException
ParseException
public final java.util.List<TypeName> typeArguments()
throws ParseException
ParseException
public final TypeName TypeArgument()
throws ParseException
ParseException
public final Token RightAngledBracket()
throws ParseException
ParseException
public final Annotation annotation()
throws ParseException
ParseException
public final Expression annotationValue()
throws ParseException
ParseException
public final ArrayInitializer annotationArrayValue()
throws ParseException
ParseException
public final void castLookahead()
throws ParseException
ParseException
public final void constructorLookahead()
throws ParseException
ParseException
public final void methodLookahead()
throws ParseException
ParseException
public final void variableLookahead()
throws ParseException
ParseExceptionpublic void ReInit(java.io.InputStream stream)
public void ReInit(java.io.InputStream stream,
java.lang.String encoding)
public void ReInit(java.io.Reader stream)
public void ReInit(ParserTokenManager tm)
public final Token getNextToken()
public final Token getToken(int index)
public ParseException generateParseException()
public final void enable_tracing()
public final void disable_tracing()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||