SpecificationD Grammar
Sourceparse.d
Documentationhttps://dlang.org/phobos/dmd_parse.html
Parser(AST, Lexer = dmd.lexer.Lexer): Lexer;loc, AST.Module_module, const(char)[]input, booldoDocComment, ErrorSinkerrorSink, const CompileEnv*compileEnv, const booldoUnittests) scope;Inputloc = location in source file of mixin
_module, const(char)[]input, booldoDocComment, ErrorSinkerrorSink, const CompileEnv*compileEnv, const booldoUnittests) scope;parseModule();parseModuleDeclaration();parseModuleContent();parseDeclDefs(intonce, AST.Dsymbol*pLastDecl = null, PrefixAttributes!AST*pAttrs = null);intonce | !=0 means parse exactly one decl or def |
AST.Dsymbol*pLastDecl | set to last decl or def parsed |
PrefixAttributes!AST*pAttrs | keep track of attributes |
parseTypeOrAssignExp(TOKendtoken = TOK.reserved);parseAssignCondition();parseStatement(intflags, const(char)**endPtr = null, Loc*pEndloc = null);Inputflags PSxxxx
OutputpEndloc if { ... statements ... }, store location of closing brace, otherwise loc of last token of statement
parseAsm(boolendOfLine);AsmStatementasm FunctionAttributes(opt) { AsmInstructionListopt }
AsmInstructionListAsmInstruction ; AsmInstruction ; AsmInstruction
boolendOfLine | true if EOL means end of asm statement |
check(Locloc, TOKvalue);value, advance to next token.Locloc | location for error message |
TOKvalue | token value to compare with |
check(TOKvalue);value, advance to next token.TOKvalue | token value to compare with |
check(TOKvalue, const(char)*string);value, advance to next token.TOKvalue | token value to compare with |
const(char)*string | for error message |
NeedDeclaratorId;skipParens(Token*t, Token**pt);Token*t | on opening ( |
Token**pt | *pt is set to token past ')' on true |
parsePrimaryExp();isBuiltinAtAttribute(Identifierident);Identifierident | identifier |
precedence;ParsedLinkage(AST);link;cppmangle;idents;identExps;