public class Parser extends Object
Constructor and Description |
---|
Parser(LookaheadScanner scanner)
Construct a parser from the given lexical analyzer.
|
Modifier and Type | Method and Description |
---|---|
JCompilationUnit |
compilationUnit()
Parse a compilation unit (a program file) and construct an AST for it.
|
boolean |
errorHasOccurred()
Has a parser error occurred up to now?
|
public Parser(LookaheadScanner scanner)
scanner
- the lexical analyzer with which tokens are scanned.public boolean errorHasOccurred()
public JCompilationUnit compilationUnit()
compilationUnit ::= [PACKAGE qualifiedIdentifier SEMI] {IMPORT qualifiedIdentifier SEMI} {typeDeclaration} EOF