View source code
Display the source code in dmd/parse.d from which this page was generated on github.
Report a bug
If you spot a problem with this page, click here to create a Bugzilla issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using local clone.

Class dmd.parse.Parser

class Parser(AST) ;


this (loc, _module, input, doDocComment) Use this constructor for string mixins.


addComment (s, blockComment)
appendStorageClass (orig, added) Provide an error message if added contains storage classes which are redundant with those in orig; otherwise, return the combination.
checkDanglingElse (elseloc)
isBuiltinAtAttribute (ident) Recognize builtin @ attributes
isDeclaration (t, needId, endtok, pt) Determine if the scanner is sitting on the start of a declaration.
parseAggregate () Parse struct, union, interface, class.
parseArguments () Collect argument list. Assume current token is ',', '(' or '['.
parseAttribute (udas) Parse attribute(s), lexer is on '@'.
parseAutoDeclarations (storageClass, comment) Parse auto declarations of the form: storageClass ident = init, ident = init, ... ; and return the array of them. Starts with token on the first ident. Ends with scanner past closing ';'
parseBaseClasses ()
parseBlock (pLastDecl, pAttrs) Parse declarations after an align, visibility, or extern decl.
parseConstraint () Parse constraint. Constraint is of the form: if ( ConstraintExpression )
parseContracts (f) Parse contracts following function declaration.
parseCtor (pAttrs) Parse a constructor definition: this(parameters) { body } or postblit: this(this) { body } or constructor template: this(templateparameters)(parameters) { body } Current token is 'this'.
parseDebugCondition () Parse a debug conditional
parseDeclarations (autodecl, pAttrs, comment) Parse Declarations. These can be: 1. declarations at global/class level 2. declarations at statement level Return array of Declaration *'s.
parseDeclarator (t, palt, pident, tpl, storageClass, pdisable, pudas) Parse Declarator
parseDefaultInitExp () Parses default argument initializer expression that is an assign expression, with special handling for _FILE__, _FILE_DIR__, _LINE__, _MODULE__, _FUNCTION__, and _PRETTY_FUNCTION__.
parseDeprecatedAttribute (msg) Parses a deprecated declaration
parseDtor (pAttrs) Parse a destructor definition: ~this() { body } Current token is '~'.
parseEnum ()
parseForeach (loc, args) Parses foreach statements, static foreach statements and static foreach declarations. The template parameter isStatic is true, iff a static foreach should be parsed. If isStatic is true, isDecl can be true to indicate that a static foreach declaration should be parsed.
parseInitializer () Parse initializer for variable declaration.
parseInvariant (pAttrs) Parse an invariant definition: invariant { statements... } invariant() { statements... } invariant (expression); Current token is 'invariant'.
parseLinkage (pidents, pIdentExps, cppmangle, cppMangleOnly)
parseMixin () Parse template mixin. mixin Foo; mixin Foo!(args); mixin a.b.c!(args).Foo!(args); mixin Foo!(args) identifier; mixin typeof(expr).identifier!(args);
parseNew (pAttrs) Parse a new definition: new(parameters) { body } Current token is 'new'.
parseNewExp (thisexp)
parseParameterList (tpl) Parse parameter list.
parsePostfix (storageClass, pudas) Parse const/immutable/shared/inout/nothrow/pure postfix
parsePrimaryExp () Expression Parser
parseQualifiedIdentifier (entity) Parse ident1.ident2.ident3
parseSharedStaticCtor (pAttrs) Parse a shared static constructor definition: shared static this() { body } Current token is 'shared'.
parseSharedStaticDtor (pAttrs) Parse a shared static destructor definition: shared static ~this() { body } Current token is 'shared'.
parseStatement (flags, endPtr, pEndloc)
parseStaticAssert () Parse a static assertion. Current token is 'static'.
parseStaticCtor (pAttrs) Parse a static constructor definition: static this() { body } Current token is 'static'.
parseStaticDtor (pAttrs) Parse a static destructor definition: static ~this() { body } Current token is 'static'.
parseStaticIfCondition () static if (expression) body else body Current token is 'static'.
parseTemplateArgumentList () Parse template argument list.
parseTemplateArguments () Parse template arguments.
parseTemplateDeclaration (ismixin) Parse a TemplateDeclaration.
parseTemplateParameterList (flag) Parse template parameter list.
parseTemplateSingleArgument () Parse single template argument, to support the syntax: foo!arg
parseTypeof () Parse typeof(expression). Current token is on the 'typeof'.
parseTypeOrAssignExp (endtoken) Parse a Type or an Expression
parseTypeSuffixes (t) Parse suffixes to type t. * [] [AssignExpression] [AssignExpression .. AssignExpression] [Type] delegate Parameters MemberFunctionAttributes(opt) function Parameters FunctionAttributes(opt)
parseUnitTest (pAttrs) Parse a unittest definition: unittest { body } Current token is 'unittest'.
parseVector () Parse _vector(type). Current token is on the '_vector'.
parseVersionCondition () Parse a version conditional
skipAttributes (t, pt) Skip attributes.
skipParens (t, pt) Skip parens, brackets.
factory (classname) Create instance of class specified by the fully qualified name classname. The class must either have no constructors or have a default constructor.
opCmp (o) Compare with another Object obj.
opEquals (o) Test whether this is equal to o. The default implementation only compares by identity (using the is operator). Generally, overrides for opEquals should attempt to compare objects by their contents.
toHash () Compute hash function for Object.
toString () Convert Object to a human readable string.




ParseForeachArgs Determines additional argument types for parseForeach.
ParseForeachRet Determines the result type for parseForeach.


Walter Bright


Boost License 1.0