dmd.parse - D Programming Language
Description: D Programming Language
Keywords: D programming language

Menu

- Learn
- Documentation
  - Language Reference
  - Library Reference
  - Command-line Reference
  - Feature Overview
  - Articles
- Downloads
- Packages
- Community
  - Blog
  - Orgs using D
  - Twitter
  - Calendar
  - Forums
  - IRC
  - Community Discord
  - Wiki
  - GitHub
  - Issues
  - Get involved
  - Contributors
  - Foundation
  - Security Team
  - Donate
  - Sponsors
- Resources
  - Tour
  - Books
  - Tutorials
  - Tools
  - Editors
  - IDEs
  - run.dlang.io
  - Visual D
  - Acknowledgments
  - D Style
  - Glossary
  - Sitemap

Search
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:
Walter Bright
License:
Boost License 1.0

Source parse.d

Documentation https://dlang.org/phobos/dmd_parse.html

Coverage https://codecov.io/gh/dlang/dmd/src/master/src/dmd/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

Copyright © 1999-2020 by the D Language Foundation | Page generated by Ddoc on Tue Jul 7 12:26:09 2020