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 a local clone.

dmd.parse

Takes a token stream from the lexer, and parses it into an abstract syntax tree.

Specification D Grammar

Authors:

Source parse.d

immutable PREC[TOK.max_] precedence;
Set operator precedence for each operator.
Used by hdrgen
class Parser(AST): Lexer;
this(ref const Loc loc, AST.Module _module, const(char)[] input, bool doDocComment);
Use this constructor for string mixins.

Input loc location in source file of mixin

RootObject parseTypeOrAssignExp(TOK endtoken = TOK.reserved);
Parse a Type or an Expression
Returns:
RootObject representing the AST
AST.Statement parseStatement(int flags, const(char)** endPtr = null, Loc* pEndloc = null);

Input flags PSxxxx

Output pEndloc if { ... statements ... }, store location of closing brace, otherwise loc of last token of statement

AST.Expression parsePrimaryExp();
Expression Parser
static StorageClass isBuiltinAtAttribute(Identifier ident);
Recognize builtin @ attributes
Parameters:
Identifier ident identifier
Returns:
storage class for attribute, 0 if not