Java Doc for Parser.java in  » Scripting » jacl » org » codehaus » janino » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Scripting » jacl » org.codehaus.janino 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.codehaus.janino.Parser

Parser
public class Parser (Code)
A parser for the JavaTM programming language.

Inner Class :public static class ParseException extends Scanner.LocatedException


Constructor Summary
public  Parser(Scanner scanner)
    

Method Summary
public  voideatToken()
    
public  ScannergetScanner()
    
public  Locationlocation()
    
public  Java.AtomparseAdditiveExpression()
    
public  Java.AtomparseAndExpression()
    
public  Java.Rvalue[]parseArgumentList()
    
public  Java.Rvalue[]parseArguments()
    
public  Java.ArrayInitializerparseArrayInitializer()
    
public  Java.AtomparseAssignmentExpression()
    
public  Java.BlockparseBlock()
    
public  Java.BlockStatementparseBlockStatement()
    
 BlockStatement := { Identifier ':' } (
 ( Modifiers Type | ModifiersOpt BasicType ) LocalVariableDeclarators ';' |
 'class' ...
public  ListparseBlockStatements()
    
 intparseBracketsOpt()
    
public  Java.StatementparseBreakStatement()
    
public  voidparseClassBody(Java.ClassDeclaration classDeclaration)
    
public  voidparseClassBodyDeclaration(Java.ClassDeclaration classDeclaration)
    
public  Java.NamedClassDeclarationparseClassDeclarationRest(String optionalDocComment, short modifiers, ClassDeclarationContext context)
    
public  Java.CompilationUnitparseCompilationUnit()
    
public  Java.AtomparseConditionalAndExpression()
    
public  Java.AtomparseConditionalExpression()
    
public  Java.AtomparseConditionalOrExpression()
    
public  Java.ConstructorDeclaratorparseConstructorDeclarator(Java.ClassDeclaration declaringClass, String optionalDocComment, short modifiers)
    
public  Java.StatementparseContinueStatement()
    
public  Java.RvalueparseDimExpr()
    
public  Java.Rvalue[]parseDimExprs()
    
public  Java.StatementparseDoStatement()
    
public  Java.StatementparseEmptyStatement()
    
public  Java.AtomparseEqualityExpression()
    
public  Java.AtomparseExclusiveOrExpression()
    
public  Java.AtomparseExpression()
    
public  Java.Rvalue[]parseExpressionList()
    
public  Java.StatementparseExpressionStatement()
    
public  Java.VariableDeclarator[]parseFieldDeclarationRest(String name)
    
public  Java.StatementparseForStatement()
    
public  Java.FunctionDeclarator.FormalParameterparseFormalParameter()
    
public  Java.FunctionDeclarator.FormalParameter[]parseFormalParameters(Java.Scope enclosingScope)
    
public  Java.StatementparseIfStatement()
    
public  Java.CompilationUnit.ImportDeclarationparseImportDeclaration()
    
public  Java.CompilationUnit.ImportDeclarationparseImportDeclarationBody()
    
public  Java.AtomparseInclusiveOrExpression()
    
public  voidparseInterfaceBody(Java.InterfaceDeclaration interfaceDeclaration)
    
public  Java.InterfaceDeclarationparseInterfaceDeclarationRest(String optionalDocComment, short modifiers, InterfaceDeclarationContext context)
    
public  Java.StatementparseLabeledStatement()
    
public  Java.AtomparseLiteral()
    
public  Java.VariableDeclarator[]parseLocalVariableDeclarators()
    
public  Java.BlockparseMethodBody()
    
public  Java.MethodDeclaratorparseMethodDeclarationRest(Java.AbstractTypeDeclaration declaringType, String optionalDocComment, short modifiers, Java.Type type, String name)
    
public  shortparseModifiersOpt()
    
public  Java.AtomparseMultiplicativeExpression()
    
public  Java.PackageDeclarationparsePackageDeclaration()
    
public  Java.PackageMemberTypeDeclarationparsePackageMemberTypeDeclaration()
    
public  Java.AtomparsePrimary()
    
public  String[]parseQualifiedIdentifier()
    
public  Java.ReferenceTypeparseReferenceType()
    
public  Java.ReferenceType[]parseReferenceTypeList()
    
public  Java.AtomparseRelationalExpression()
    
public  Java.StatementparseReturnStatement()
    
public  Java.AtomparseSelector(Java.Atom atom)
    
public  Java.AtomparseShiftExpression()
    
public  Java.StatementparseStatement()
    
 Statement :=
 LabeledStatement |
 Block |
 IfStatement |
 ForStatement |
 WhileStatement |
 DoStatement |
 TryStatement |
 'switch' ...
public  Java.StatementparseSwitchStatement()
    
public  Java.StatementparseSynchronizedStatement()
    
public  Java.StatementparseThrowStatement()
    
public  Java.StatementparseTryStatement()
    
public  Java.TypeparseType()
    
public  Java.AtomparseUnaryExpression()
    
public  Java.VariableDeclaratorparseVariableDeclarator()
    
public  Java.VariableDeclaratorparseVariableDeclaratorRest(String name)
    
 VariableDeclaratorRest := { '[' ']' } [ '=' VariableInitializer ]
 
Used by field declarations and local variable declarations.
public  Java.ArrayInitializerOrRvalueparseVariableInitializer()
    
public  Java.StatementparseWhileStatement()
    
public  booleanpeekIdentifier()
    
public  booleanpeekKeyword()
    
public  booleanpeekKeyword(String keyword)
    
public  booleanpeekKeyword(String[] keywords)
    
public  booleanpeekOperator(String operator)
    
public  booleanpeekOperator(String[] operators)
    
public  StringreadIdentifier()
    
public  voidreadKeyword(String keyword)
    
public  StringreadOperator()
    
public  voidreadOperator(String operator)
    
public  voidsetWarningHandler(WarningHandler optionalWarningHandler)
     By default, warnings are discarded, but an application my install a WarningHandler .

Notice that there is no Parser.setErrorHandler() method, but parse errors always throw a ParseException .

final protected  voidthrowParseException(String message)
     Convenience method for throwing a ParseException.


Constructor Detail
Parser
public Parser(Scanner scanner)(Code)




Method Detail
eatToken
public void eatToken() throws Scanner.ScanException, IOException(Code)



getScanner
public Scanner getScanner()(Code)



location
public Location location()(Code)



parseAdditiveExpression
public Java.Atom parseAdditiveExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 AdditiveExpression :=
 MultiplicativeExpression { ( '+' | '-' ) MultiplicativeExpression }
 



parseAndExpression
public Java.Atom parseAndExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 AndExpression :=
 EqualityExpression { '&' EqualityExpression }
 



parseArgumentList
public Java.Rvalue[] parseArgumentList() throws ParseException, Scanner.ScanException, IOException(Code)
 ArgumentList := Expression { ',' Expression }
 



parseArguments
public Java.Rvalue[] parseArguments() throws ParseException, Scanner.ScanException, IOException(Code)
 Arguments := '(' [ ArgumentList ] ')'
 



parseArrayInitializer
public Java.ArrayInitializer parseArrayInitializer() throws ParseException, Scanner.ScanException, IOException(Code)
 ArrayInitializer :=
 '{' [ VariableInitializer { ',' VariableInitializer } [ ',' ] '}'
 



parseAssignmentExpression
public Java.Atom parseAssignmentExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 AssignmentExpression :=
 ConditionalExpression [ AssignmentOperator AssignmentExpression ]
 AssignmentOperator :=
 '=' | '*=' | '/=' | '%=' | '+=' | '-=' | '<<=' |
 '>>=' | '>>>=' | '&=' | '^=' | '|='
 



parseBlock
public Java.Block parseBlock() throws ParseException, Scanner.ScanException, IOException(Code)
 '{' BlockStatements '}'
 



parseBlockStatement
public Java.BlockStatement parseBlockStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 BlockStatement := { Identifier ':' } (
 ( Modifiers Type | ModifiersOpt BasicType ) LocalVariableDeclarators ';' |
 'class' ... |
 Statement |
 'final' Type LocalVariableDeclarators ';' |
 Expression ';' |
 Expression LocalVariableDeclarators ';'   (1)
 )
 
(1) "Expression" must pose a type, and has optional trailing brackets.



parseBlockStatements
public List parseBlockStatements() throws ParseException, Scanner.ScanException, IOException(Code)
 BlockStatements := { BlockStatement }
 



parseBracketsOpt
int parseBracketsOpt() throws Scanner.ScanException, IOException(Code)
 BracketsOpt := { '[' ']' }
 



parseBreakStatement
public Java.Statement parseBreakStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 BreakStatement := 'break' [ Identifier ] ';'
 



parseClassBody
public void parseClassBody(Java.ClassDeclaration classDeclaration) throws ParseException, Scanner.ScanException, IOException(Code)
 ClassBody := '{' { ClassBodyDeclaration } '}'
 



parseClassBodyDeclaration
public void parseClassBodyDeclaration(Java.ClassDeclaration classDeclaration) throws ParseException, Scanner.ScanException, IOException(Code)
 ClassBodyDeclaration :=
 ';' |
 ModifiersOpt (
 Block |                                    // Instance (JLS2 8.6) or static initializer (JLS2 8.7)
 'void' Identifier MethodDeclarationRest |
 'class' ClassDeclarationRest |
 'interface' InterfaceDeclarationRest |
 ConstructorDeclarator |
 Type Identifier (
 MethodDeclarationRest |
 FieldDeclarationRest ';'
 )
 )
 



parseClassDeclarationRest
public Java.NamedClassDeclaration parseClassDeclarationRest(String optionalDocComment, short modifiers, ClassDeclarationContext context) throws ParseException, Scanner.ScanException, IOException(Code)
 ClassDeclarationRest :=
 Identifier
 [ 'extends' ReferenceType ]
 [ 'implements' ReferenceTypeList ]
 ClassBody
 



parseCompilationUnit
public Java.CompilationUnit parseCompilationUnit() throws ParseException, Scanner.ScanException, IOException(Code)
 CompilationUnit := [ PackageDeclaration ]
 { ImportDeclaration }
 { TypeDeclaration }
 



parseConditionalAndExpression
public Java.Atom parseConditionalAndExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 ConditionalAndExpression :=
 InclusiveOrExpression { '&&' InclusiveOrExpression }
 



parseConditionalExpression
public Java.Atom parseConditionalExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 ConditionalExpression :=
 ConditionalOrExpression [ '?' Expression ':' ConditionalExpression ]
 



parseConditionalOrExpression
public Java.Atom parseConditionalOrExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 ConditionalOrExpression :=
 ConditionalAndExpression { '||' ConditionalAndExpression ]
 



parseConstructorDeclarator
public Java.ConstructorDeclarator parseConstructorDeclarator(Java.ClassDeclaration declaringClass, String optionalDocComment, short modifiers) throws ParseException, Scanner.ScanException, IOException(Code)
 ConstructorDeclarator :=
 Identifier
 FormalParameters
 [ 'throws' ReferenceTypeList ]
 '{'
 [ 'this' Arguments ';' | 'super' Arguments ';' | Primary '.' 'super' Arguments ';' ]
 BlockStatements
 '}'
 



parseContinueStatement
public Java.Statement parseContinueStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 ContinueStatement := 'continue' [ Identifier ] ';'
 



parseDimExpr
public Java.Rvalue parseDimExpr() throws Scanner.ScanException, ParseException, IOException(Code)
 DimExpr := '[' Expression ']'
 



parseDimExprs
public Java.Rvalue[] parseDimExprs() throws ParseException, Scanner.ScanException, IOException(Code)
 DimExprs := DimExpr { DimExpr }
 



parseDoStatement
public Java.Statement parseDoStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 DoStatement := 'do' Statement 'while' '(' Expression ')' ';'
 



parseEmptyStatement
public Java.Statement parseEmptyStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 EmptyStatement := ';'
 



parseEqualityExpression
public Java.Atom parseEqualityExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 EqualityExpression :=
 RelationalExpression { ( '==' | '!=' ) RelationalExpression }
 



parseExclusiveOrExpression
public Java.Atom parseExclusiveOrExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 ExclusiveOrExpression :=
 AndExpression { '^' AndExpression }
 



parseExpression
public Java.Atom parseExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 Expression := AssignmentExpression
 



parseExpressionList
public Java.Rvalue[] parseExpressionList() throws ParseException, Scanner.ScanException, IOException(Code)
 ExpressionList := Expression { ',' Expression }
 



parseExpressionStatement
public Java.Statement parseExpressionStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 ExpressionStatement := Expression ';'
 



parseFieldDeclarationRest
public Java.VariableDeclarator[] parseFieldDeclarationRest(String name) throws ParseException, Scanner.ScanException, IOException(Code)
 FieldDeclarationRest :=
 VariableDeclaratorRest
 { ',' VariableDeclarator }
 



parseForStatement
public Java.Statement parseForStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 ForStatement :=
 'for' '('
 [ ForInit ] ';'
 [ Expression ] ';'
 [ ExpressionList ]
 ')' Statement
 



parseFormalParameter
public Java.FunctionDeclarator.FormalParameter parseFormalParameter() throws ParseException, Scanner.ScanException, IOException(Code)
 FormalParameter := [ 'final' ] Type Identifier BracketsOpt
 



parseFormalParameters
public Java.FunctionDeclarator.FormalParameter[] parseFormalParameters(Java.Scope enclosingScope) throws ParseException, Scanner.ScanException, IOException(Code)
 FormalParameters := '(' [ FormalParameter { ',' FormalParameter } ] ')'
 



parseIfStatement
public Java.Statement parseIfStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 IfStatement := 'if' '(' Expression ')' Statement [ 'else' Statement ]
 



parseImportDeclaration
public Java.CompilationUnit.ImportDeclaration parseImportDeclaration() throws ParseException, Scanner.ScanException, IOException(Code)
 ImportDeclaration := 'import' ImportDeclarationBody ';'
 



parseImportDeclarationBody
public Java.CompilationUnit.ImportDeclaration parseImportDeclarationBody() throws ParseException, Scanner.ScanException, IOException(Code)
 ImportDeclarationBody := Identifier { '.' Identifier } [ '.' '*' ]
 



parseInclusiveOrExpression
public Java.Atom parseInclusiveOrExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 InclusiveOrExpression :=
 ExclusiveOrExpression { '|' ExclusiveOrExpression }
 



parseInterfaceBody
public void parseInterfaceBody(Java.InterfaceDeclaration interfaceDeclaration) throws ParseException, Scanner.ScanException, IOException(Code)
 InterfaceBody := '{' {
 ';' |
 ModifiersOpt (
 'void' Identifier MethodDeclarationRest |
 'class' ClassDeclarationRest |
 'interface' InterfaceDeclarationRest |
 Type Identifier (
 MethodDeclarationRest |
 FieldDeclarationRest
 )
 )
 } '}'
 



parseInterfaceDeclarationRest
public Java.InterfaceDeclaration parseInterfaceDeclarationRest(String optionalDocComment, short modifiers, InterfaceDeclarationContext context) throws ParseException, Scanner.ScanException, IOException(Code)
 InterfaceDeclarationRest :=
 Identifier
 [ 'extends' ReferenceTypeList ]
 InterfaceBody
 



parseLabeledStatement
public Java.Statement parseLabeledStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 LabeledStatement := Identifier ':' Statement
 



parseLiteral
public Java.Atom parseLiteral() throws ParseException, Scanner.ScanException, IOException(Code)



parseLocalVariableDeclarators
public Java.VariableDeclarator[] parseLocalVariableDeclarators() throws ParseException, Scanner.ScanException, IOException(Code)
 LocalVariableDeclarators := VariableDeclarator { ',' VariableDeclarator }
 



parseMethodBody
public Java.Block parseMethodBody() throws ParseException, Scanner.ScanException, IOException(Code)
 MethodBody := Block
 



parseMethodDeclarationRest
public Java.MethodDeclarator parseMethodDeclarationRest(Java.AbstractTypeDeclaration declaringType, String optionalDocComment, short modifiers, Java.Type type, String name) throws ParseException, Scanner.ScanException, IOException(Code)
 MethodDeclarationRest :=
 FormalParameters
 { '[' ']' }
 [ 'throws' ReferenceTypeList ]
 ( ';' | MethodBody )
 



parseModifiersOpt
public short parseModifiersOpt() throws ParseException, Scanner.ScanException, IOException(Code)
 ModifiersOpt := { 'public' | 'protected' | 'private' | 'static' |
 'abstract' | 'final' | 'native' | 'synchronized' |
 'transient' | 'volatile' | 'strictfp'
 



parseMultiplicativeExpression
public Java.Atom parseMultiplicativeExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 MultiplicativeExpression :=
 UnaryExpression { ( '*' | '/' | '%' ) UnaryExpression }
 



parsePackageDeclaration
public Java.PackageDeclaration parsePackageDeclaration() throws Parser.ParseException, Scanner.ScanException, IOException(Code)
 PackageDeclaration := 'package' QualifiedIdentifier ';'
 



parsePackageMemberTypeDeclaration
public Java.PackageMemberTypeDeclaration parsePackageMemberTypeDeclaration() throws ParseException, Scanner.ScanException, IOException(Code)
 PackageMemberTypeDeclaration :=
 ModifiersOpt 'class' ClassDeclarationRest |
 ModifiersOpt 'interface' InterfaceDeclarationRest
 



parsePrimary
public Java.Atom parsePrimary() throws ParseException, Scanner.ScanException, IOException(Code)
 Primary :=
 CastExpression |                        // CastExpression 15.16
 '(' Expression ')' |                    // ParenthesizedExpression 15.8.5
 Literal |                               // Literal 15.8.1
 Name |                                  // AmbiguousName
 Name Arguments |                        // MethodInvocation
 Name '[]' { '[]' } |                    // ArrayType 10.1
 Name '[]' { '[]' } '.' 'class' |        // ClassLiteral 15.8.2
 'this' |                                // This 15.8.3
 'this' Arguments |                      // Alternate constructor invocation 8.8.5.1
 'super' Arguments |                     // Unqualified superclass constructor invocation 8.8.5.1
 'super' '.' Identifier |                // SuperclassFieldAccess 15.11.2
 'super' '.' Identifier Arguments |      // SuperclassMethodInvocation 15.12.4.9
 NewClassInstance |
 NewAnonymousClassInstance |             // ClassInstanceCreationExpression 15.9
 NewArray |                              // ArrayCreationExpression 15.10
 NewInitializedArray |                   // ArrayInitializer 10.6
 BasicType { '[]' } |                    // Type
 BasicType { '[]' } '.' 'class' |        // ClassLiteral 15.8.2
 'void' '.' 'class'                      // ClassLiteral 15.8.2
 CastExpression :=
 '(' PrimitiveType { '[]' } ')' UnaryExpression |
 '(' Expression ')' UnaryExpression
 NewClassInstance := 'new' ReferenceType Arguments
 NewAnonymousClassInstance := 'new' ReferenceType Arguments [ ClassBody ]
 NewArray := 'new' Type DimExprs { '[]' }
 NewInitializedArray := 'new' ArrayType ArrayInitializer
 



parseQualifiedIdentifier
public String[] parseQualifiedIdentifier() throws ParseException, Scanner.ScanException, IOException(Code)
QualifiedIdentifier := Identifier { '.' Identifier }



parseReferenceType
public Java.ReferenceType parseReferenceType() throws ParseException, Scanner.ScanException, IOException(Code)
 ReferenceType := QualifiedIdentifier
 



parseReferenceTypeList
public Java.ReferenceType[] parseReferenceTypeList() throws ParseException, Scanner.ScanException, IOException(Code)
 ReferenceTypeList := ReferenceType { ',' ReferenceType }
 



parseRelationalExpression
public Java.Atom parseRelationalExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 RelationalExpression :=
 ShiftExpression {
 ( ( '<' | '>' | '<=' | '>=' ) ShiftExpression ) |
 ( 'instanceof' ReferenceType )
 }
 



parseReturnStatement
public Java.Statement parseReturnStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 ReturnStatement := 'return' [ Expression ] ';'
 



parseSelector
public Java.Atom parseSelector(Java.Atom atom) throws ParseException, Scanner.ScanException, IOException(Code)
 Selector :=
 '.' Identifier |                       // FieldAccess 15.11.1
 '.' Identifier Arguments |             // MethodInvocation
 '.' 'this'                             // QualifiedThis 15.8.4
 '.' 'super' Arguments                  // Qualified superclass constructor invocation (JLS 8.8.5.1)
 '.' 'super' '.' Identifier |           // SuperclassFieldReference (JLS 15.11.2)
 '.' 'super' '.' Identifier Arguments | // SuperclassMethodInvocation (JLS 15.12.4.9)
 '.' 'new' Identifier Arguments [ ClassBody ] | // QualifiedClassInstanceCreationExpression  15.9
 '.' 'class'
 '[' Expression ']'                     // ArrayAccessExpression 15.13
 



parseShiftExpression
public Java.Atom parseShiftExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 ShiftExpression :=
 AdditiveExpression { ( '<<' | '>>' | '>>>' ) AdditiveExpression }
 



parseStatement
public Java.Statement parseStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 Statement :=
 LabeledStatement |
 Block |
 IfStatement |
 ForStatement |
 WhileStatement |
 DoStatement |
 TryStatement |
 'switch' ... |
 'synchronized' ... |
 ReturnStatement |
 ThrowStatement |
 BreakStatement |
 ContinueStatement |
 EmptyStatement |
 ExpressionStatement
 



parseSwitchStatement
public Java.Statement parseSwitchStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 SwitchStatement :=
 'switch' '(' Expression ')' '{' { SwitchLabels BlockStatements } '}'
 SwitchLabels := SwitchLabels { SwitchLabels }
 SwitchLabel := 'case' Expression ':' | 'default' ':'
 



parseSynchronizedStatement
public Java.Statement parseSynchronizedStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 SynchronizedStatement :=
 'synchronized' '(' expression ')' Block
 



parseThrowStatement
public Java.Statement parseThrowStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 ThrowStatement := 'throw' Expression ';'
 



parseTryStatement
public Java.Statement parseTryStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 TryStatement :=
 'try' Block Catches [ Finally ] |
 'try' Block Finally
 Catches := CatchClause { CatchClause }
 CatchClause := 'catch' '(' FormalParameter ')' Block
 Finally := 'finally' Block
 



parseType
public Java.Type parseType() throws ParseException, Scanner.ScanException, IOException(Code)
 Type := (
 'byte' | 'short' | 'char' | 'int' | 'long' |
 'float' | 'double' | 'boolean' |
 ReferenceType
 ) { '[' ']' }
 



parseUnaryExpression
public Java.Atom parseUnaryExpression() throws ParseException, Scanner.ScanException, IOException(Code)
 UnaryExpression :=
 { PrefixOperator } Primary { Selector } { PostfixOperator }
 PrefixOperator := '++' | '--' | '+' | '-' | '~' | '!'
 PostfixOperator := '++' | '--'
 



parseVariableDeclarator
public Java.VariableDeclarator parseVariableDeclarator() throws ParseException, Scanner.ScanException, IOException(Code)
 VariableDeclarator := Identifier VariableDeclaratorRest
 



parseVariableDeclaratorRest
public Java.VariableDeclarator parseVariableDeclaratorRest(String name) throws ParseException, Scanner.ScanException, IOException(Code)
 VariableDeclaratorRest := { '[' ']' } [ '=' VariableInitializer ]
 
Used by field declarations and local variable declarations.



parseVariableInitializer
public Java.ArrayInitializerOrRvalue parseVariableInitializer() throws ParseException, Scanner.ScanException, IOException(Code)
 VariableInitializer :=
 ArrayInitializer |
 Expression
 



parseWhileStatement
public Java.Statement parseWhileStatement() throws ParseException, Scanner.ScanException, IOException(Code)
 WhileStatement := 'while' '(' Expression ')' Statement
 



peekIdentifier
public boolean peekIdentifier()(Code)



peekKeyword
public boolean peekKeyword()(Code)



peekKeyword
public boolean peekKeyword(String keyword)(Code)



peekKeyword
public boolean peekKeyword(String[] keywords)(Code)



peekOperator
public boolean peekOperator(String operator)(Code)



peekOperator
public boolean peekOperator(String[] operators)(Code)



readIdentifier
public String readIdentifier() throws ParseException, Scanner.ScanException, IOException(Code)



readKeyword
public void readKeyword(String keyword) throws ParseException, Scanner.ScanException, IOException(Code)



readOperator
public String readOperator() throws ParseException, Scanner.ScanException, IOException(Code)



readOperator
public void readOperator(String operator) throws ParseException, Scanner.ScanException, IOException(Code)



setWarningHandler
public void setWarningHandler(WarningHandler optionalWarningHandler)(Code)
By default, warnings are discarded, but an application my install a WarningHandler .

Notice that there is no Parser.setErrorHandler() method, but parse errors always throw a ParseException . The reason being is that there is no reasonable way to recover from parse errors and continue parsing, so there is no need to install a custom parse error handler.
Parameters:
  optionalWarningHandler - null to indicate that no warnings be issued




throwParseException
final protected void throwParseException(String message) throws ParseException(Code)
Convenience method for throwing a ParseException.



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.