Class Parser

D Parser.

class 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.


allocator RollbackAllocator*Allocator used for creating AST nodes
errorCount uintCurrent error count
fileName stringName used when reporting warnings and errors
messageDelegate void delegate(string, ulong, ulong, string, bool)Function or delegate 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.
messageFunction void function(string, ulong, ulong, string, bool)Function or delegate 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.
tokens const(TokenStructure!(ubyte,"\x0a string comment;\x0a string trailingComment;\x0a\x0a int opCmp(size_t i) const pure nothrow @safe {\x0a if (index < i) return -1;\x0a if (index > i) return 1;\x0a return 0;\x0a }\x0a\x0a int opCmp(ref const typeof(this) other) const pure nothrow @safe {\x0a return opCmp(other.index);\x0a }\x0a"))[]Tokens to parse
warningCount uintCurrent warning count
_traceDepth int
cachedAAChecks bool[ulong]
comment string
index ulong
REGISTER_NAMES immutable(char[][])
suppressedErrorCount uint
suppressMessages int


current[get] TokenStructure!(ubyte,"\x0a string comment;\x0a string trailingComment;\x0a\x0a int opCmp(size_t i) const pure nothrow @safe {\x0a if (index < i) return -1;\x0a if (index > i) return 1;\x0a return 0;\x0a }\x0a\x0a int opCmp(ref const typeof(this) other) const pure nothrow @safe {\x0a return opCmp(other.index);\x0a }\x0a")
previous[get] TokenStructure!(ubyte,"\x0a string comment;\x0a string trailingComment;\x0a\x0a int opCmp(size_t i) const pure nothrow @safe {\x0a if (index < i) return -1;\x0a if (index > i) return 1;\x0a return 0;\x0a }\x0a\x0a int opCmp(ref const typeof(this) other) const pure nothrow @safe {\x0a return opCmp(other.index);\x0a }\x0a")


parseAddExpression Parses an AddExpression.
parseAliasDeclaration Parses an AliasDeclaration.
parseAliasInitializer Parses an AliasInitializer.
parseAliasThisDeclaration Parses an AliasThisDeclaration.
parseAlignAttribute Parses an AlignAttribute.
parseAndAndExpression Parses an AndAndExpression.
parseAndExpression Parses an AndExpression.
parseAnonymousEnumDeclaration anonymousEnumDeclaration: 'enum' (':' type)? '{' anonymousEnumMember+ '}' ;
parseAnonymousEnumMember anonymousEnumMember: type identifier '=' assignExpression | identifier '=' assignExpression | identifier ;
parseArgumentList Parses an ArgumentList.
parseArguments Parses Arguments.
parseArrayInitializer Parses an ArrayInitializer.
parseArrayLiteral Parses an ArrayLiteral.
parseArrayMemberInitialization Parses an ArrayMemberInitialization.
parseAsmAddExp Parses an AsmAddExp
parseAsmAndExp Parses an AsmAndExp
parseAsmBrExp Parses an AsmBrExp
parseAsmEqualExp Parses an AsmEqualExp
parseAsmExp Parses an AsmExp
parseAsmInstruction Parses an AsmInstruction
parseAsmLogAndExp Parses an AsmLogAndExp
parseAsmLogOrExp Parses an AsmLogOrExp
parseAsmMulExp Parses an AsmMulExp
parseAsmOrExp Parses an AsmOrExp
parseAsmPrimaryExp Parses an AsmPrimaryExp
parseAsmRelExp Parses an AsmRelExp
parseAsmShiftExp Parses an AsmShiftExp
parseAsmStatement Parses an AsmStatement
parseAsmTypePrefix Parses an AsmTypePrefix
parseAsmUnaExp Parses an AsmUnaExp
parseAsmXorExp Parses an AsmXorExp
parseAssertArguments Parses an AssertArguments
parseAssertExpression Parses an AssertExpression
parseAssignExpression Parses an AssignExpression
parseAssocArrayLiteral Parses an AssocArrayLiteral
parseAtAttribute Parses an AtAttribute
parseAttribute Parses an Attribute
parseAttributeDeclaration Parses an AttributeDeclaration
parseAutoDeclaration Parses an AutoDeclaration
parseAutoDeclarationPart Parses an AutoDeclarationPart
parseBaseClass Parses a BaseClass
parseBaseClassList Parses a BaseClassList
parseBlockStatement Parses a BlockStatement
parseBreakStatement Parses a BreakStatement
parseBuiltinType Parses an BuiltinType
parseCaseRangeStatement Parses a CaseRangeStatement
parseCaseStatement Parses an CaseStatement
parseCastExpression Parses a CastExpression
parseCastQualifier Parses a CastQualifier
parseCatch Parses a Catch
parseCatches Parses a Catches
parseClassDeclaration Parses a ClassDeclaration
parseCmpExpression Parses a CmpExpression
parseCompileCondition Parses a CompileCondition
parseConditionalDeclaration Parses a ConditionalDeclaration
parseConditionalStatement Parses a ConditionalStatement
parseConstraint Parses a Constraint
parseConstructor Parses a Constructor
parseContinueStatement Parses an ContinueStatement
parseDebugCondition Parses a DebugCondition
parseDebugSpecification Parses a DebugSpecification
parseDeclaration Parses a Declaration
parseDeclarationOrStatement Parses a DeclarationOrStatement
parseDeclarationsAndStatements Parses DeclarationsAndStatements
parseDeclarator Parses a Declarator
parseDeclaratorIdentifierList Parses a DeclaratorIdentifierList
parseDefaultStatement Parses a DefaultStatement
parseDeleteExpression Parses a DeleteExpression
parseDeprecated Parses a Deprecated attribute
parseDestructor Parses a Destructor
parseDoStatement Parses a DoStatement
parseEnumBody Parses an EnumBody
parseEnumDeclaration Parses an EnumDeclaration
parseEnumMember Parses an EnumMember
parseEnumMemberAttribute Parses an EnumMemberAttribute
parseEponymousTemplateDeclaration Parses an EponymousTemplateDeclaration
parseEqualExpression Parses an EqualExpression
parseExpression Parses an Expression
parseExpressionStatement Parses an ExpressionStatement
parseFinally Parses a Finally
parseFinalSwitchStatement Parses a FinalSwitchStatement
parseForeachStatement Parses a ForeachStatement
parseForeachType Parses a ForeachType
parseForeachTypeList Parses a ForeachTypeList
parseForStatement Parses a ForStatement
parseFunctionAttribute Parses a FunctionAttribute
parseFunctionBody Parses a FunctionBody. Note that any change of this function must also be applied in dsymbol SimpleParser, which can be found here.
parseFunctionCallExpression Parses a FunctionCallExpression
parseFunctionContract Parses a FunctionContract
parseFunctionDeclaration Parses a FunctionDeclaration
parseFunctionLiteralExpression Parses a FunctionLiteralExpression
parseGotoStatement Parses a GotoStatement
parseIdentifierChain Parses an IdentifierChain
parseIdentifierOrTemplateChain Parses an IdentifierOrTemplateChain
parseIdentifierOrTemplateInstance Parses an IdentifierOrTemplateInstance
parseIdentityExpression Parses an IdentityExpression
parseIfStatement Parses an IfStatement
parseImportBind Parses an ImportBind
parseImportBindings Parses ImportBindings
parseImportDeclaration Parses an ImportDeclaration
parseImportExpression Parses an ImportExpression
parseInContractExpression Parses an InContractExpression
parseIndex Parses an Index
parseIndexExpression Parses an IndexExpression
parseInExpression Parses an InExpression
parseInitializer Parses an Initializer
parseInOutContractExpression Parses an InOutContractExpression
parseInOutStatement Parses an InOutStatement
parseInStatement Parses an InStatement
parseInterfaceDeclaration Parses an InterfaceDeclaration
parseInvariant Parses an Invariant
parseIsExpression Parses an IsExpression
parseKeyValuePair Parses a KeyValuePair
parseKeyValuePairs Parses KeyValuePairs
parseLabeledStatement Parses a LabeledStatement
parseLastCatch Parses a LastCatch
parseLinkageAttribute Parses a LinkageAttribute
parseMemberFunctionAttribute Parses a MemberFunctionAttribute
parseMissingFunctionBody Parses a MissingFunctionBody
parseMixinDeclaration Parses a MixinDeclaration
parseMixinExpression Parses a MixinExpression
parseMixinTemplateDeclaration Parses a MixinTemplateDeclaration
parseMixinTemplateName Parses a MixinTemplateName
parseModule Parses a Module
parseModuleDeclaration Parses a ModuleDeclaration
parseMulExpression Parses a MulExpression.
parseNewAnonClassExpression Parses a NewAnonClassExpression
parseNewExpression Parses a NewExpression
parseNonVoidInitializer Parses a NonVoidInitializer
parseOperands Parses Operands
parseOrExpression Parses an OrExpression
parseOrOrExpression Parses an OrOrExpression
parseOutContractExpression Parses an OutContractExpression
parseOutStatement Parses an OutStatement
parseParameter Parses a Parameter
parseParameterAttribute Parses a ParameterAttribute
parseParameters Parses Parameters
parsePostblit Parses a Postblit
parsePowExpression Parses a PowExpression
parsePragmaDeclaration Parses a PragmaDeclaration
parsePragmaExpression Parses a PragmaExpression
parsePragmaStatement Parses a PragmaStatement
parsePrimaryExpression Parses a PrimaryExpression
parseRegister Parses a Register
parseRelExpression Parses a RelExpression
parseReturnStatement Parses a ReturnStatement
parseScopeGuardStatement Parses a ScopeGuardStatement
parseSharedStaticConstructor Parses a SharedStaticConstructor
parseSharedStaticDestructor Parses a SharedStaticDestructor
parseShiftExpression Parses a ShiftExpression
parseSingleImport Parses a SingleImport
parseSpecifiedFunctionBody Parses a SpecifiedFunctionBody
parseStatement Parses a Statement
parseStatementNoCaseNoDefault Parses a StatementNoCaseNoDefault
parseStaticAssertDeclaration Parses a StaticAssertDeclaration
parseStaticAssertStatement Parses a StaticAssertStatement
parseStaticConstructor Parses a StaticConstructor
parseStaticDestructor Parses a StaticDestructor
parseStaticForeachDeclaration Parses a StaticForeachDeclaration
parseStaticForeachStatement Parses a StaticForeachStatement
parseStaticIfCondition Parses an StaticIfCondition
parseStorageClass Parses a StorageClass
parseStructBody Parses a StructBody
parseStructDeclaration Parses a StructDeclaration
parseStructInitializer Parses an StructInitializer
parseStructMemberInitializer Parses a StructMemberInitializer
parseStructMemberInitializers Parses StructMemberInitializers
parseSwitchStatement Parses a SwitchStatement
parseSymbol Parses a Symbol
parseSynchronizedStatement Parses a SynchronizedStatement
parseTemplateAliasParameter Parses a TemplateAliasParameter
parseTemplateArgument Parses a TemplateArgument
parseTemplateArgumentList Parses a TemplateArgumentList
parseTemplateArguments Parses TemplateArguments
parseTemplateDeclaration Parses a TemplateDeclaration
parseTemplateInstance Parses a TemplateInstance
parseTemplateMixinExpression Parses a TemplateMixinExpression
parseTemplateParameter Parses a TemplateParameter
parseTemplateParameterList Parses a TemplateParameterList
parseTemplateParameters Parses TemplateParameters
parseTemplateSingleArgument Parses a TemplateSingleArgument
parseTemplateThisParameter Parses a TemplateThisParameter
parseTemplateTupleParameter Parses an TemplateTupleParameter
parseTemplateTypeParameter Parses a TemplateTypeParameter
parseTemplateValueParameter Parses a TemplateValueParameter
parseTemplateValueParameterDefault Parses a TemplateValueParameterDefault
parseTernaryExpression Parses a TernaryExpression
parseThrowStatement Parses a ThrowStatement
parseTraitsExpression Parses an TraitsExpression
parseTryStatement Parses a TryStatement
parseType Parses a Type
parseType2 Parses a Type2
parseTypeConstructor Parses a TypeConstructor
parseTypeConstructors Parses TypeConstructors
parseTypeIdentifierPart Parses a TypeIdentifierPart.
parseTypeidExpression Parses a TypeidExpression
parseTypeofExpression Parses a TypeofExpression
parseTypeSpecialization Parses a TypeSpecialization
parseTypeSuffix Parses a TypeSuffix
parseUnaryExpression Parses a UnaryExpression
parseUnionDeclaration Parses an UnionDeclaration
parseUnittest Parses a Unittest
parseVariableDeclaration Parses a VariableDeclaration
parseVector Parses a Vector
parseVersionCondition Parses a VersionCondition
parseVersionSpecification Parses a VersionSpecification
parseWhileStatement Parses a WhileStatement
parseWithStatement Parses a WithStatement
parseXorExpression Parses an XorExpression
advance Advances to the next token and returns the current token
expect Returns a token of the specified type if it was the next token, otherwise calls the error function and returns null. Advances the lexer by one token.
isType Only use this in template parameter parsing