public class Parser
D Parser.
It is sometimes useful to sub-class Parser to skip over things that are not interesting. For example, DCD skips over function bodies when caching symbols from imported files.

Variables

errorCount
uint
Current error count
warningCount
uint
Current warning count
fileName
string
Name used when reporting warnings and errors
allocator
CAllocator
Allocator used for creating AST nodes
messageFunction
void function(string, size_t, size_t, string, bool)
Function that is called when a warning or error is encountered. The parameters are the file name, line number, column number, and the error or warning message.

Functions

parseAddExpressionParses an AddExpression.
parseAliasDeclarationParses an AliasDeclaration.
parseAliasInitializerParses an AliasInitializer.
parseAliasThisDeclarationParses an AliasThisDeclaration.
parseAlignAttributeParses an AlignAttribute.
parseAndAndExpressionParses an AndAndExpression.
parseAndExpressionParses an AndExpression.
parseArgumentListParses an ArgumentList.
parseArgumentsParses Arguments.
parseArrayInitializerParses an ArrayInitializer.
parseArrayLiteralParses an ArrayLiteral.
parseArrayMemberInitializationParses an ArrayMemberInitialization.
parseAsmAddExpParses an AsmAddExp
parseAsmAndExpParses an AsmAndExp
parseAsmBrExpParses an AsmBrExp
parseAsmEqualExpParses an AsmEqualExp
parseAsmExpParses an AsmExp
parseAsmInstructionParses an AsmInstruction
parseAsmLogAndExpParses an AsmLogAndExp
parseAsmLogOrExpParses an AsmLogOrExp
parseAsmMulExpParses an AsmMulExp
parseAsmOrExpParses an AsmOrExp
parseAsmPrimaryExpParses an AsmPrimaryExp
parseAsmRelExpParses an AsmRelExp
parseAsmShiftExpParses an AsmShiftExp
parseAsmStatementParses an AsmStatement
parseAsmTypePrefixParses an AsmTypePrefix
parseAsmUnaExpParses an AsmUnaExp
parseAsmXorExpParses an AsmXorExp
parseAssertExpressionParses an AssertExpression
parseAssignExpressionParses an AssignExpression
parseAssocArrayLiteralParses an AssocArrayLiteral
parseAtAttributeParses an AtAttribute
parseAttributeParses an Attribute
parseAttributeDeclarationParses an AttributeDeclaration
parseAutoDeclarationParses an AutoDeclaration
parseBlockStatementParses a BlockStatement
parseBodyStatementParses a BodyStatement
parseBreakStatementParses a BreakStatement
parseBaseClassParses a BaseClass
parseBaseClassListParses a BaseClassList
parseBasicTypeParses an BuiltinType
parseCaseRangeStatementParses a CaseRangeStatement
parseCaseStatementParses an CaseStatement
parseCastExpressionParses a CastExpression
parseCastQualifierParses a CastQualifier
parseCatchParses a Catch
parseCatchesParses a Catches
parseClassDeclarationParses a ClassDeclaration
parseCmpExpressionParses a CmpExpression
parseCompileConditionParses a CompileCondition
parseConditionalDeclarationParses a ConditionalDeclaration
parseConditionalStatementParses a ConditionalStatement
parseConstraintParses a Constraint
parseConstructorParses a Constructor
parseContinueStatementParses an ContinueStatement
parseDebugConditionParses a DebugCondition
parseDebugSpecificationParses a DebugSpecification
parseDeclarationParses a Declaration
parseDeclarationsAndStatementsParses DeclarationsAndStatements
parseDeclarationOrStatementParses a DeclarationOrStatement
parseDeclaratorParses a Declarator
parseDefaultStatementParses a DefaultStatement
parseDeleteExpressionParses a DeleteExpression
parseDeprecatedParses a Deprecated attribute
parseDestructorParses a Destructor
parseDoStatementParses a DoStatement
parseEnumBodyParses an EnumBody
parseEnumDeclarationParses an EnumDeclaration
parseEnumMemberParses an EnumMember
parseEqualExpressionParses an EqualExpression
parseExpressionParses an Expression
parseExpressionStatementParses an ExpressionStatement
parseFinalSwitchStatementParses a FinalSwitchStatement
parseFinallyParses a Finally
parseForStatementParses a ForStatement
parseForeachStatementParses a ForeachStatement
parseForeachTypeParses a ForeachType
parseForeachTypeListParses a ForeachTypeList
parseFunctionAttributeParses a FunctionAttribute
parseFunctionBodyParses a FunctionBody
parseFunctionCallExpressionParses a FunctionCallExpression
parseFunctionDeclarationParses a FunctionDeclaration
parseFunctionLiteralExpressionParses a FunctionLiteralExpression
parseGotoStatementParses a GotoStatement
parseIdentifierChainParses an IdentifierChain
parseIdentifierListParses an IdentifierList
parseIdentifierOrTemplateChainParses an IdentifierOrTemplateChain
parseIdentifierOrTemplateInstanceParses an IdentifierOrTemplateInstance
parseIdentityExpressionParses an IdentityExpression
parseIfStatementParses an IfStatement
parseImportBindParses an ImportBind
parseImportBindingsParses ImportBindings
parseImportDeclarationParses an ImportDeclaration
parseImportExpressionParses an ImportExpression
parseIndexExpressionParses an IndexExpression
parseInExpressionParses an InExpression
parseInStatementParses an InStatement
parseInitializerParses an Initializer
parseInterfaceDeclarationParses an InterfaceDeclaration
parseInvariantParses an Invariant
parseIsExpressionParses an IsExpression
parseKeyValuePairParses a KeyValuePair
parseKeyValuePairsParses KeyValuePairs
parseLabeledStatementParses a LabeledStatement
parseLambdaExpressionParses a LambdaExpression
parseLastCatchParses a LastCatch
parseLinkageAttributeParses a LinkageAttribute
parseMemberFunctionAttributeParses a MemberFunctionAttribute
parseMixinDeclarationParses a MixinDeclaration
parseMixinExpressionParses a MixinExpression
parseMixinTemplateDeclarationParses a MixinTemplateDeclaration
parseMixinTemplateNameParses a MixinTemplateName
parseModuleParses a Module
parseModuleDeclarationParses a ModuleDeclaration
parseMulExpressionParses a MulExpression.
parseNewAnonClassExpressionParses a NewAnonClassExpression
parseNewExpressionParses a NewExpression
parseStatementNoCaseNoDefaultParses a StatementNoCaseNoDefault
parseNonVoidInitializerParses a NonVoidInitializer
parseOperandsParses Operands
parseOrExpressionParses an OrExpression
parseOrOrExpressionParses an OrOrExpression
parseOutStatementParses an OutStatement
parseParameterParses a Parameter
parseParameterAttributeParses a ParameterAttribute
parseParametersParses Parameters
parsePostblitParses a Postblit
parsePowExpressionParses a PowExpression
parsePragmaDeclarationParses a PragmaDeclaration
parsePragmaExpressionParses a PragmaExpression
parsePrimaryExpressionParses a PrimaryExpression
parseRegisterParses a Register
parseRelExpressionParses a RelExpression
parseReturnStatementParses a ReturnStatement
parseScopeGuardStatementParses a ScopeGuardStatement
parseSharedStaticConstructorParses a SharedStaticConstructor
parseSharedStaticDestructorParses a SharedStaticDestructor
parseShiftExpressionParses a ShiftExpression
parseSingleImportParses a SingleImport
parseSliceExpressionParses a SliceExpression
parseStatementParses a Statement
parseStaticAssertDeclarationParses a StaticAssertDeclaration
parseStaticAssertStatementParses a StaticAssertStatement
parseStaticConstructorParses a StaticConstructor
parseStaticDestructorParses a StaticDestructor
parseStaticIfConditionParses an StaticIfCondition
parseStorageClassParses a StorageClass
parseStructBodyParses a StructBody
parseStructDeclarationParses a StructDeclaration
parseStructInitializerParses an StructInitializer
parseStructMemberInitializerParses a StructMemberInitializer
parseStructMemberInitializersParses StructMemberInitializers
parseSwitchStatementParses a SwitchStatement
parseSymbolParses a Symbol
parseSynchronizedStatementParses a SynchronizedStatement
parseTemplateAliasParameterParses a TemplateAliasParameter
parseTemplateArgumentParses a TemplateArgument
parseTemplateArgumentListParses a TemplateArgumentList
parseTemplateArgumentsParses TemplateArguments
parseTemplateDeclarationParses a TemplateDeclaration
parseEponymousTemplateDeclarationParses an EponymousTemplateDeclaration
parseTemplateInstanceParses a TemplateInstance
parseTemplateMixinExpressionParses a TemplateMixinExpression
parseTemplateParameterParses a TemplateParameter
parseTemplateParameterListParses an TemplateParameterList
parseTemplateParametersParses TemplateParameters
parseTemplateSingleArgumentParses a TemplateSingleArgument
parseTemplateThisParameterParses a TemplateThisParameter
parseTemplateTupleParameterParses an TemplateTupleParameter
parseTemplateTypeParameterParses a TemplateTypeParameter
parseTemplateValueParameterParses a TemplateValueParameter
parseTemplateValueParameterDefaultParses a TemplateValueParameterDefault
parseTernaryExpressionParses a TernaryExpression
parseThrowStatementParses a ThrowStatement
parseTraitsExpressionParses an TraitsExpression
parseTryStatementParses a TryStatement
parseTypeParses a Type
parseType2Parses a Type2
parseTypeConstructorParses a TypeConstructor
parseTypeConstructorsParses TypeConstructors
parseTypeSpecializationParses a TypeSpecialization
parseTypeSuffixParses a TypeSuffix
parseTypeidExpressionParses a TypeidExpression
parseTypeofExpressionParses a TypeofExpression
parseUnaryExpressionParses a UnaryExpression
parseUnionDeclarationParses an UnionDeclaration
parseUnittestParses a Unittest
parseVariableDeclarationParses a VariableDeclaration
parseVectorParses a Vector
parseVersionConditionParses a VersionCondition
parseVersionSpecificationParses a VersionSpecification
parseWhileStatementParses a WhileStatement
parseWithStatementParses a WithStatement
parseXorExpressionParses an XorExpression
moreTokensReturns: true if there are more tokens
expectReturns a token of the specified type if it was the next token, otherwise calls the error function and returns null.
currentReturns: the _current token
advanceAdvances to the next token and returns the current token
currentIsReturns: true if the current token has the given type
currentIsOneOfReturns: true if the current token is one of the given types