Expand description

This module implements a first stage recursive descent parser for VHDL. It can process a stream of input tokens into the coarse, generalized abstract syntax tree defined in ast. The grammar productions/rules outlined in the VHDL standard are collapsed into more general rules as outlined in the following table.

VHDL StandardGeneralized to
aggregateparen_expr
array_constraintname
attribute_declarationattr_decl
attribute_namename
attribute_specificationattr_decl
block_specificationname
configuration_itemdecl_item
constraintprimary_expr
enumeration_type_definitionparen_expr
external_nameignored
function_callname
generate_specificationexpr
generic_clausegeneric_clause
generic_map_aspectmap_aspect
group_declarationgroup_decl
group_template_declarationgroup_decl
indexed_namename
interface_subprogram_declarationsubprog_spec
namename
name/character_literalprimary_name
name/operator_symbolprimary_name
name/simple_nameprimary_name
port_clauseport_clause
port_map_aspectmap_aspect
range_constraintname
record_constraintname, paren_expr
resolution_indicationprimary_expr
selected_namename
slice_namename
subprogram_bodysubprog_spec
subprogram_declarationsubprog_spec
subprogram_instantiation_declarationsubprog_spec
subtype_indicationname, primary_expr
targetprimary_expr
time_expressionexpr
type_markname

Structs

Enums

The precedence of an expression.

Traits

Functions

Parse an alias declaration. See IEEE 1076-2008 section 6.6.

Parse an architecture body. See IEEE 1076-2008 section 3.3.

Parse an assertion statement. See IEEE 1076-2008 section 10.3.

Parse the tail of an assign statement. This function assumes that the name of the signal to be assigned has already been parsed. See IEEE 1076-2008 section 10.5.

Parse an attribute declaration or specification. See IEEE 1076-2008 sections 6.7 and 7.2.

Parse a binding indication. See IEEE 1076-2008 section 7.3.2.1. The trailing semicolon is required only if at least one of the aspect has been parsed.

Parse a block or component configuration. See IEEE 1076-2008 sections 3.4.2 and 3.4.3.

Parse a block or component configuration declarative item.

Parse a block or component specification. See IEEE 1067-2008 section 7.3.1.

Parse a block statement. See IEEE 1076-2008 section 11.2.

Parse a generate case statement. See IEEE 1076-2008 section 11.8.

Parse a case statement. See IEEE 1076-2008 section 10.9.

Parse a component declaration. See IEEE 1076-2008 section 6.8.

Parse a list of conditional waveforms. See IEEE 1076-2008 section 10.5.

Parse a configuration declaration. See IEEE 1076-2008 section 3.4.

Parse a configuration specification. See IEEE 1076-2008 section 7.3.1.

Parse a context declaration. IEEE 1076-2008 section 13.3.

Parse an entire design file. IEEE 1076-2008 section 13.1.

Parse a single design unit. IEEE 1076-2008 section 13.1.

Parse a disconnection specification. See IEEE 1076-2008 section 7.4.

Parse an entity class. See IEEE 1076-2008 section 7.2.

Parse an entity declaration. See IEEE 1076-2008 section 3.2.

Parse an expression with a precedence higher than prec.

Parse an expression suffix. Given an already parsed expression and its precedence, try to parse additional tokens that extend the already parsed expression. This is currently limited to binary operations.

Parse a generate for statement. See IEEE 1076-2008 section 11.8.

Parse a generate body. See IEEE 1076-2008 section 11.8.

Parse a group declaration or group template declaration. See IEEE 1076-2008 sections 6.9 and 6.10.

Parse a generate if statement. See IEEE 1076-2008 section 11.8.

Parse an if statement. See IEEE 1076-2008 section 10.8.

Parse the tail of an instantiation or procedure call statement. See IEEE 1076-2008 sections 10.7, 11.4, and 11.7.

Parse an interface declaration. These are generally part of an interface list as they appear in generic and port clauses within for example entity declarations. See IEEE 1076-2008 section 6.5.1.

Parse a library clause. IEEE 1076-2008 section 13.2.

Parse a loop statement. See IEEE 1076-2008 section 10.10.

Parse a name. IEEE 1076-2008 section 8.

Parse the suffix to a name. IEEE 1076-2008 section 8.

Parse a next or exit statement. See IEEE 1076-2008 sections 10.11 and 10.12.

Parse a null statement. See IEEE 1076-2008 section 10.14.

Parse a constant, signal, variable, or file declaration. See IEEE 1076-2008 section 6.4.2.

Parse a package body. See IEEE 1076-2008 section 4.8.

Parse a package declaration. See IEEE 1076-2008 section 4.7.

Parse a package instantiation declaration. See IEEE 1076-2008 section 4.9.

Try to parse a parenthesized expression. This is a combination of a variety of rules from the VHDL grammar. Most notably, it combines the following:

Parse a process statement. See IEEE 1076-2008 section 11.3.

Parse a report statement. See IEEE 1076-2008 section 10.4.

Parse a return statement. See IEEE 1076-2008 section 10.13.

Parse a select assign statement. See IEEE 1076-2008 section 10.5.

Parse a list of selected waveforms. See IEEE 1076-2008 section 10.5.

Parse a sequential or concurrent statement.

Parse a subprogram declarative item, which is either a subprogram declaration, body, or instantiation. See IEEE 1076-2008 section 4.2.

Parse a subprogram specification. This covers the initial part of a subprogram declaration, body, instantiation, or interface declaration. See IEEE 1076-2008 sections 4.2 and 6.5.4. Note that not all combinations of keywords and qualifiers that this parser accepts are actually valid.

Parse a subtype declaration. See IEEE 1076-2008 section 6.3.

Parse a subtype indication. See IEEE 1076-2008 section 6.3.

Parse a type declaration. See IEEE 1076-2008 section 6.2.

Parse a use clause. IEEE 1076-2008 section 12.4.

Parse a wait statement. See IEEE 1076-2008 section 10.2.

Parse a waveform. See IEEE 1076-2008 section 10.5.

Parse a context item. IEEE 1076-2008 section 13.4.

Try to parse a declarative item. See IEEE 1076-2008 section 3.2.3.

Try to parse a delay mechanism.

Try to parse a generic clause. See IEEE 1076-2008 section 6.5.6.2.

Parse an optional label, which basically is just an identifier followed by a colon. This is interesting for statement parsing. See IEEE 1076-2008 section 10.

Try to parse a generic or port map aspect. See IEEE 1076-2008 sections 6.5.7.2 and 6.5.7.3.

Try to parse a name. IEEE 1076-2008 section 8.

Try to parse a port clause. See IEEE 1076-2008 section 6.5.6.3.

Try to parse a primary name. IEEE 1076-2008 section 8.

Type Definitions