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
precedence
for each operator.Discussion
Used by hdrgen
-
Declaration
class
Parser
(AST): Lexer;-
Declaration
this(ref const Loc
loc
, AST.Module_module
, const(char)[]input
, booldoDocComment
);Use this constructor for string mixins.
Input:
loc
location in source file of mixin -
Declaration
RootObject
parseTypeOrAssignExp
(TOKendtoken
= TOK.reserved);Parse a Type or an Expression
Return Value
RootObject representing the AST
-
Declaration
AST.Parameter
parseAssignCondition
();Parse an assignment condition for if or while statements.
Return Value
The variable that is declared inside the condition
-
Declaration
AST.Statement
parseStatement
(intflags
, const(char)**endPtr
= null, Loc*pEndloc
= null);Input:
flags
PSxxxxOutput:
pEndloc
if { ... statements ... }, store location of closing brace, otherwise loc of last token of statement -
Declaration
AST.Expression
parsePrimaryExp
();Expression Parser
-
Declaration
static StorageClass
isBuiltinAtAttribute
(Identifierident
);Recognize builtin @ attributes
Parameters
Identifier
ident
identifier
Return Value
storage class for attribute, 0 if not
-