org.eclipse.jdt.internal.compiler.parser
Class Parser

java.lang.Object
  extended by org.eclipse.jdt.internal.compiler.parser.Parser
All Implemented Interfaces:
OperatorIds, TypeIds, ParserBasicInformation, TerminalTokens
Direct Known Subclasses:
AssistParser, CodeSnippetParser, CommentRecorderParser, DocumentElementParser, MatchLocatorParser, RacParser

public class Parser
extends java.lang.Object
implements ParserBasicInformation, TerminalTokens, OperatorIds, TypeIds


Field Summary
static char[] asb
           
static char[] asr
           
static char[] base_action
           
static int BracketKinds
           
static short[] check_table
           
 CompilationUnitDeclaration compilationUnit
           
static int CurlyBracket
           
 int currentToken
           
 int firstToken
           
static char[] in_symb
           
 Javadoc javadoc
           
 JavadocParser javadocParser
           
 int lastAct
           
static char[] lhs
           
 boolean methodRecoveryActivated
           
static java.lang.String[] name
           
static char[] nasb
           
static char[] nasr
           
static char[] non_terminal_index
           
static java.lang.String[] readableName
           
 ReadManager readManager
           
static char[] recovery_templates
           
static char[] recovery_templates_index
           
 RecoveryScanner recoveryScanner
           
 ReferenceContext referenceContext
           
 boolean reportOnlyOneSyntaxError
           
 boolean reportSyntaxErrorIsRequired
           
static int[] reverse_index
           
static byte[] rhs
           
static int RoundBracket
           
static long[] rules_compliance
           
 Scanner scanner
           
static byte[] scope_la
           
static char[] scope_lhs
           
static char[] scope_prefix
           
static char[] scope_rhs
           
static char[] scope_state
           
static char[] scope_state_set
           
static char[] scope_suffix
           
static int SquareBracket
           
static char[] statements_recovery_filter
           
static char[] term_action
           
static byte[] term_check
           
static char[] terminal_index
           
static boolean VERBOSE_RECOVERY
           
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.parser.ParserBasicInformation
ACCEPT_ACTION, EOFT_SYMBOL, EOLT_SYMBOL, ERROR_ACTION, ERROR_SYMBOL, LA_STATE_OFFSET, MAX_LA, MAX_NAME_LENGTH, NT_OFFSET, NUM_NON_TERMINALS, NUM_RULES, NUM_STATES, NUM_SYMBOLS, NUM_TERMINALS, SCOPE_SIZE, SCOPE_UBOUND, START_STATE
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.parser.TerminalTokens
TokenNameabstract, TokenNamealso, TokenNameAND, TokenNameAND_AND, TokenNameAND_EQUAL, TokenNameassert, TokenNameAssignableOrSynonym, TokenNameAssignableRedundantlyOrSynonym, TokenNameassume, TokenNameassume_redundantly, TokenNameAT, TokenNameaxiom, TokenNameBehaviorOrSynonym, TokenNameboolean, TokenNamebreak, TokenNamebyte, TokenNamecase, TokenNamecatch, TokenNamechar, TokenNameCharacterLiteral, TokenNameclass, TokenNamecode_bigint_math, TokenNamecode_java_math, TokenNamecode_safe_math, TokenNameCOLON, TokenNameCOMMA, TokenNameCOMMENT_BLOCK, TokenNameCOMMENT_JAVADOC, TokenNameCOMMENT_LINE, TokenNameconst, TokenNameconstraint, TokenNameconstraint_redundantly, TokenNamecontinue, TokenNamedecreases, TokenNamedecreases_redundantly, TokenNamedefault, TokenNamediverges, TokenNamediverges_redundantly, TokenNameDIVIDE, TokenNameDIVIDE_EQUAL, TokenNamedo, TokenNameDOT, TokenNameDOTDOT, TokenNamedouble, TokenNameDoubleLiteral, TokenNameELLIPSIS, TokenNameelse, TokenNameEnsuresOrSynonym, TokenNameEnsuresRedundantlyOrSynonym, TokenNameenum, TokenNameEOF, TokenNameEQUAL, TokenNameEQUAL_EQUAL, TokenNameEQUIV, TokenNameERROR, TokenNameextends, TokenNamefalse, TokenNamefinal, TokenNamefinally, TokenNamefloat, TokenNameFloatingPointLiteral, TokenNamefor, TokenNameforall, TokenNameghost, TokenNamegoto, TokenNameGREATER, TokenNameGREATER_EQUAL, TokenNamehelper, TokenNameIdentifier, TokenNameif, TokenNameimplements, TokenNameIMPLIES, TokenNameimplies_that, TokenNameimport, TokenNamein, TokenNamein_redundantly, TokenNameInformalDescription, TokenNameinitially, TokenNameinstance, TokenNameinstanceof, TokenNameint, TokenNameIntegerLiteral, TokenNameinterface, TokenNameinvariant, TokenNameinvariant_redundantly, TokenNamejml_assert, TokenNamejml_assert_redundantly, TokenNameLBRACE, TokenNameLBRACE_OR, TokenNameLBRACKET, TokenNameLEFT_SHIFT, TokenNameLEFT_SHIFT_EQUAL, TokenNameLESS, TokenNameLESS_EQUAL, TokenNamelong, TokenNameLongLiteral, TokenNameloop_invariant, TokenNameloop_invariant_redundantly, TokenNameLPAREN, TokenNamemaps, TokenNamemaps_redundantly, TokenNameMINUS, TokenNameMINUS_EQUAL, TokenNameMINUS_MINUS, TokenNamemodel, TokenNamemono_non_null, TokenNameMULTIPLY, TokenNameMULTIPLY_EQUAL, TokenNamenative, TokenNamenew, TokenNamenon_null, TokenNamenon_null_by_default, TokenNameNOT, TokenNameNOT_EQUAL, TokenNameNOT_EQUIV, TokenNamenowarn, TokenNamenull, TokenNamenullable, TokenNamenullable_by_default, TokenNameold, TokenNameOR, TokenNameOR_EQUAL, TokenNameOR_OR, TokenNameOR_RBRACE, TokenNamepackage, TokenNamepeer, TokenNamePLUS, TokenNamePLUS_EQUAL, TokenNamePLUS_PLUS, TokenNameprivate, TokenNameprotected, TokenNamepublic, TokenNamepure, TokenNameQUESTION, TokenNameRBRACE, TokenNameRBRACKET, TokenNamereadonly, TokenNameREMAINDER, TokenNameREMAINDER_EQUAL, TokenNamerep, TokenNamerepresents, TokenNameREPRESENTS, TokenNamerepresents_redundantly, TokenNameRequiresOrSynonym, TokenNameRequiresRedundantlyOrSynonym, TokenNamereturn, TokenNameREV_IMPLIES, TokenNameRIGHT_SHIFT, TokenNameRIGHT_SHIFT_EQUAL, TokenNameRPAREN, TokenNameSEMICOLON, TokenNameset, TokenNameshort, TokenNamesignals_only, TokenNamesignals_only_redundantly, TokenNameSignalsOrSynonym, TokenNameSignalsRedundantlyOrSynonym, TokenNameslash_elemtype, TokenNameslash_everything, TokenNameslash_exists, TokenNameslash_forall, TokenNameslash_fresh, TokenNameslash_into, TokenNameslash_max, TokenNameslash_min, TokenNameslash_nonnullelements, TokenNameslash_not_assigned, TokenNameslash_not_modified, TokenNameslash_not_specified, TokenNameslash_nothing, TokenNameslash_num_of, TokenNameslash_old, TokenNameslash_peer, TokenNameslash_pre, TokenNameslash_product, TokenNameslash_readonly, TokenNameslash_rep, TokenNameslash_result, TokenNameslash_same, TokenNameslash_sum, TokenNameslash_type, TokenNameslash_typeof, TokenNamespec_bigint_math, TokenNamespec_java_math, TokenNamespec_protected, TokenNamespec_public, TokenNamespec_safe_math, TokenNamestatic, TokenNamestrictfp, TokenNameStringLiteral, TokenNameSUBTYPE, TokenNamesuper, TokenNameswitch, TokenNamesynchronized, TokenNamethis, TokenNamethrow, TokenNamethrows, TokenNametransient, TokenNametrue, TokenNametry, TokenNameTWIDDLE, TokenNameuninitialized, TokenNameUNSIGNED_RIGHT_SHIFT, TokenNameUNSIGNED_RIGHT_SHIFT_EQUAL, TokenNamevoid, TokenNamevolatile, TokenNamewhile, TokenNameWHITESPACE, TokenNameXOR, TokenNameXOR_EQUAL
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.ast.OperatorIds
AND, AND_AND, DIVIDE, EQUAL, EQUAL_EQUAL, GREATER, GREATER_EQUAL, INSTANCEOF, JML_ELEMTYPE, JML_EQUIV, JML_IMPLIES, JML_NONNULLELEMENTS, JML_NOT_ASSIGNED, JML_NOT_EQUIV, JML_NOT_MODIFIED, JML_OLD, JML_PRE, JML_REPRESENTS, JML_REV_IMPLIES, JML_TYPE, JML_TYPEOF, JmlOtherOpIdStart, LEFT_SHIFT, LESS, LESS_EQUAL, MINUS, MINUS_MINUS, MULTIPLY, NOT, NOT_EQUAL, NumberOfExtraTablesForJML, NumberOfTables, OR, OR_OR, PLUS, PLUS_PLUS, QUESTIONCOLON, REMAINDER, RIGHT_SHIFT, TWIDDLE, UNSIGNED_RIGHT_SHIFT, XOR
 
Fields inherited from interface org.eclipse.jdt.internal.compiler.lookup.TypeIds
Boolean2Boolean, Boolean2Int, Boolean2String, BOXING, Byte2Byte, Byte2Char, Byte2Double, Byte2Float, Byte2Int, Byte2Long, Byte2Short, Byte2String, Char2Byte, Char2Char, Char2Double, Char2Float, Char2Int, Char2Long, Char2Short, Char2String, COMPILE_TYPE_MASK, Double2Byte, Double2Char, Double2Double, Double2Float, Double2Int, Double2Long, Double2Short, Double2String, Float2Byte, Float2Char, Float2Double, Float2Float, Float2Int, Float2Long, Float2Short, Float2String, IMPLICIT_CONVERSION_MASK, Int2Byte, Int2Char, Int2Double, Int2Float, Int2Int, Int2Long, Int2Short, Int2String, Long2Byte, Long2Char, Long2Double, Long2Float, Long2Int, Long2Long, Long2Short, Long2String, NoId, Null2String, Object2Object, Object2String, Short2Byte, Short2Char, Short2Double, Short2Float, Short2Int, Short2Long, Short2Short, Short2String, String2String, T_boolean, T_byte, T_char, T_double, T_float, T_int, T_JavaIoException, T_JavaIoExternalizable, T_JavaIoObjectStreamException, T_JavaIoPrintStream, T_JavaIoSerializable, T_JavaLangAnnotationAnnotation, T_JavaLangAnnotationDocumented, T_JavaLangAnnotationElementType, T_JavaLangAnnotationInherited, T_JavaLangAnnotationRetention, T_JavaLangAnnotationRetentionPolicy, T_JavaLangAnnotationTarget, T_JavaLangAssertionError, T_JavaLangBoolean, T_JavaLangByte, T_JavaLangCharacter, T_JavaLangClass, T_JavaLangClassNotFoundException, T_JavaLangCloneable, T_JavaLangDeprecated, T_JavaLangDouble, T_JavaLangEnum, T_JavaLangError, T_JavaLangException, T_JavaLangFloat, T_JavaLangIllegalArgumentException, T_JavaLangInteger, T_JavaLangIterable, T_JavaLangLong, T_JavaLangNoClassDefError, T_JavaLangObject, T_JavaLangOverride, T_JavaLangReflectConstructor, T_JavaLangReflectField, T_JavaLangReflectMethod, T_JavaLangRuntimeException, T_JavaLangShort, T_JavaLangString, T_JavaLangStringBuffer, T_JavaLangStringBuilder, T_JavaLangSuppressWarnings, T_JavaLangSystem, T_JavaLangThrowable, T_JavaLangVoid, T_JavaUtilIterator, T_long, T_null, T_short, T_undefined, T_void, UNBOXING
 
Constructor Summary
Parser(ProblemReporter problemReporter, boolean optimizeStringLiterals)
           
 
Method Summary
 void arrayInitializer(int length)
           
static int asi(int state)
           
static short base_check(int i)
           
static void buildFilesFromLPG(java.lang.String dataFilename, java.lang.String dataFilename2)
           
 RecoveredElement buildInitialRecoveryState()
           
 void checkComment()
           
 boolean containsComment(int sourceStart, int sourceEnd)
          Given the current comment stack, answer whether some comment is available in a certain exclusive range
 MethodDeclaration convertToMethodDeclaration(ConstructorDeclaration c, CompilationResult compilationResult)
           
 CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit, CompilationResult compilationResult)
           
 int flushCommentsDefinedPriorTo(int position)
           
 int getFirstToken()
           
 int[] getJavaDocPositions()
           
 void getMethodBodies(CompilationUnitDeclaration unit)
           
 void goForBlockStatementsopt()
           
 void goForBlockStatementsOrCatchHeader()
           
 void goForClassBodyDeclarations()
           
 void goForCompilationUnit()
           
 void goForExpression()
           
 void goForFieldDeclaration()
           
 void goForGenericMethodDeclaration()
           
 void goForHeaders()
           
 void goForImportDeclaration()
           
 void goForInitializer()
           
 void goForMemberValue()
           
 void goForMethodBody()
           
 void goForPackageDeclaration()
           
 void goForTypeDeclaration()
           
static int in_symbol(int state)
           
 void initialize()
           
 void initialize(boolean initializeNLS)
           
 void initializeScanner()
           
static void initTables()
           
 void jumpOverMethodBody()
           
static int nasi(int state)
           
static int ntAction(int state, int sym)
           
 void parse(ConstructorDeclaration cd, CompilationUnitDeclaration unit, boolean recordLineSeparator)
           
 void parse(FieldDeclaration field, TypeDeclaration type, CompilationUnitDeclaration unit, char[] initializationSource)
           
 CompilationUnitDeclaration parse(ICompilationUnit sourceUnit, CompilationResult compilationResult)
           
 CompilationUnitDeclaration parse(ICompilationUnit sourceUnit, CompilationResult compilationResult, int start, int end)
           
 void parse(Initializer initializer, TypeDeclaration type, CompilationUnitDeclaration unit)
           
 void parse(MethodDeclaration md, CompilationUnitDeclaration unit)
           
 ASTNode[] parseClassBodyDeclarations(char[] source, int offset, int length, CompilationUnitDeclaration unit)
           
 Expression parseExpression(char[] source, int offset, int length, CompilationUnitDeclaration unit)
           
 Expression parseMemberValue(char[] source, int offset, int length, CompilationUnitDeclaration unit)
           
 void parseStatements(ReferenceContext rc, int start, int end, TypeDeclaration[] types, CompilationUnitDeclaration unit)
           
 void persistLineSeparatorPositions()
           
 ProblemReporter problemReporter()
          Returns this parser's problem reporter initialized with its reference context.
 void recoveryExitFromVariable()
           
 void recoveryTokenCheck()
           
 void setMethodsFullRecovery(boolean enabled)
           
 void setStatementsRecovery(boolean enabled)
           
static int tAction(int state, int sym)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

asb

public static char[] asb

asr

public static char[] asr

base_action

public static char[] base_action

BracketKinds

public static final int BracketKinds
See Also:
Constant Field Values

check_table

public static short[] check_table

CurlyBracket

public static final int CurlyBracket
See Also:
Constant Field Values

in_symb

public static char[] in_symb

lhs

public static char[] lhs

name

public static java.lang.String[] name

nasb

public static char[] nasb

nasr

public static char[] nasr

non_terminal_index

public static char[] non_terminal_index

readableName

public static java.lang.String[] readableName

rhs

public static byte[] rhs

reverse_index

public static int[] reverse_index

recovery_templates_index

public static char[] recovery_templates_index

recovery_templates

public static char[] recovery_templates

statements_recovery_filter

public static char[] statements_recovery_filter

rules_compliance

public static long[] rules_compliance

RoundBracket

public static final int RoundBracket
See Also:
Constant Field Values

scope_la

public static byte[] scope_la

scope_lhs

public static char[] scope_lhs

scope_prefix

public static char[] scope_prefix

scope_rhs

public static char[] scope_rhs

scope_state

public static char[] scope_state

scope_state_set

public static char[] scope_state_set

scope_suffix

public static char[] scope_suffix

SquareBracket

public static final int SquareBracket
See Also:
Constant Field Values

term_action

public static char[] term_action

term_check

public static byte[] term_check

terminal_index

public static char[] terminal_index

VERBOSE_RECOVERY

public static boolean VERBOSE_RECOVERY

compilationUnit

public CompilationUnitDeclaration compilationUnit

currentToken

public int currentToken

firstToken

public int firstToken

lastAct

public int lastAct

referenceContext

public ReferenceContext referenceContext

reportOnlyOneSyntaxError

public boolean reportOnlyOneSyntaxError

reportSyntaxErrorIsRequired

public boolean reportSyntaxErrorIsRequired

methodRecoveryActivated

public boolean methodRecoveryActivated

recoveryScanner

public RecoveryScanner recoveryScanner

scanner

public Scanner scanner

javadoc

public Javadoc javadoc

javadocParser

public JavadocParser javadocParser

readManager

public ReadManager readManager
Constructor Detail

Parser

public Parser(ProblemReporter problemReporter,
              boolean optimizeStringLiterals)
Method Detail

asi

public static int asi(int state)

base_check

public static final short base_check(int i)

buildFilesFromLPG

public static final void buildFilesFromLPG(java.lang.String dataFilename,
                                           java.lang.String dataFilename2)

in_symbol

public static int in_symbol(int state)

initTables

public static final void initTables()
                             throws java.io.IOException
Throws:
java.io.IOException

nasi

public static int nasi(int state)

ntAction

public static int ntAction(int state,
                           int sym)

tAction

public static int tAction(int state,
                          int sym)

arrayInitializer

public void arrayInitializer(int length)

buildInitialRecoveryState

public RecoveredElement buildInitialRecoveryState()

checkComment

public void checkComment()

containsComment

public boolean containsComment(int sourceStart,
                               int sourceEnd)
Given the current comment stack, answer whether some comment is available in a certain exclusive range

Parameters:
sourceStart - int
sourceEnd - int
Returns:
boolean

convertToMethodDeclaration

public MethodDeclaration convertToMethodDeclaration(ConstructorDeclaration c,
                                                    CompilationResult compilationResult)

dietParse

public CompilationUnitDeclaration dietParse(ICompilationUnit sourceUnit,
                                            CompilationResult compilationResult)

flushCommentsDefinedPriorTo

public int flushCommentsDefinedPriorTo(int position)

getFirstToken

public int getFirstToken()

getJavaDocPositions

public int[] getJavaDocPositions()

getMethodBodies

public void getMethodBodies(CompilationUnitDeclaration unit)

goForBlockStatementsopt

public void goForBlockStatementsopt()

goForBlockStatementsOrCatchHeader

public void goForBlockStatementsOrCatchHeader()

goForClassBodyDeclarations

public void goForClassBodyDeclarations()

goForCompilationUnit

public void goForCompilationUnit()

goForExpression

public void goForExpression()

goForFieldDeclaration

public void goForFieldDeclaration()

goForGenericMethodDeclaration

public void goForGenericMethodDeclaration()

goForHeaders

public void goForHeaders()

goForImportDeclaration

public void goForImportDeclaration()

goForInitializer

public void goForInitializer()

goForMemberValue

public void goForMemberValue()

goForMethodBody

public void goForMethodBody()

goForPackageDeclaration

public void goForPackageDeclaration()

goForTypeDeclaration

public void goForTypeDeclaration()

initialize

public void initialize()

initialize

public void initialize(boolean initializeNLS)

initializeScanner

public void initializeScanner()

jumpOverMethodBody

public void jumpOverMethodBody()

parse

public void parse(ConstructorDeclaration cd,
                  CompilationUnitDeclaration unit,
                  boolean recordLineSeparator)

parse

public void parse(FieldDeclaration field,
                  TypeDeclaration type,
                  CompilationUnitDeclaration unit,
                  char[] initializationSource)

parse

public CompilationUnitDeclaration parse(ICompilationUnit sourceUnit,
                                        CompilationResult compilationResult)

parse

public CompilationUnitDeclaration parse(ICompilationUnit sourceUnit,
                                        CompilationResult compilationResult,
                                        int start,
                                        int end)

parse

public void parse(Initializer initializer,
                  TypeDeclaration type,
                  CompilationUnitDeclaration unit)

parse

public void parse(MethodDeclaration md,
                  CompilationUnitDeclaration unit)

parseClassBodyDeclarations

public ASTNode[] parseClassBodyDeclarations(char[] source,
                                            int offset,
                                            int length,
                                            CompilationUnitDeclaration unit)

parseExpression

public Expression parseExpression(char[] source,
                                  int offset,
                                  int length,
                                  CompilationUnitDeclaration unit)

parseMemberValue

public Expression parseMemberValue(char[] source,
                                   int offset,
                                   int length,
                                   CompilationUnitDeclaration unit)

parseStatements

public void parseStatements(ReferenceContext rc,
                            int start,
                            int end,
                            TypeDeclaration[] types,
                            CompilationUnitDeclaration unit)

persistLineSeparatorPositions

public void persistLineSeparatorPositions()

problemReporter

public ProblemReporter problemReporter()
Returns this parser's problem reporter initialized with its reference context. Also it is assumed that a problem is going to be reported, so initializes the compilation result's line positions.

Returns:
ProblemReporter

recoveryExitFromVariable

public void recoveryExitFromVariable()

recoveryTokenCheck

public void recoveryTokenCheck()

setMethodsFullRecovery

public void setMethodsFullRecovery(boolean enabled)

setStatementsRecovery

public void setStatementsRecovery(boolean enabled)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object