dmd.parse
Takes a token stream from the lexer, and parses it into an abstract syntax tree.
Specification: D Grammar
License
Source: parse.d
Documentation: https://dlang.org/phobos/dmd_parse.html
-
Declaration
immutable PREC[TOK.max + 1]precedence;Set operator
precedencefor each operator.Discussion
Used by hdrgen
-
Declaration
classParser(AST): Lexer;-
Declaration
this(ref const Locloc, AST.Module_module, const(char)[]input, booldoDocComment);Use this constructor for string mixins.
Input:
loclocation in source file of mixin -
Declaration
RootObjectparseTypeOrAssignExp(TOKendtoken= TOK.reserved);Parse a Type or an Expression
Return Value
RootObject representing the AST
-
Declaration
AST.ParameterparseAssignCondition();Parse an assignment condition for if or while statements.
Return Value
The variable that is declared inside the condition
-
Declaration
AST.StatementparseStatement(intflags, const(char)**endPtr= null, Loc*pEndloc= null);Input:
flagsPSxxxxOutput:
pEndlocif { ... statements ... }, store location of closing brace, otherwise loc of last token of statement -
Declaration
AST.ExpressionparsePrimaryExp();Expression Parser
-
Declaration
static StorageClassisBuiltinAtAttribute(Identifierident);Recognize builtin @ attributes
Parameters
Identifieridentidentifier
Return Value
storage class for attribute, 0 if not
-