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 Standard | Generalized to |
---|---|
aggregate | paren_expr |
array_constraint | name |
attribute_declaration | attr_decl |
attribute_name | name |
attribute_specification | attr_decl |
block_specification | name |
configuration_item | decl_item |
constraint | primary_expr |
enumeration_type_definition | paren_expr |
external_name | ignored |
function_call | name |
generate_specification | expr |
generic_clause | generic_clause |
generic_map_aspect | map_aspect |
group_declaration | group_decl |
group_template_declaration | group_decl |
indexed_name | name |
interface_subprogram_declaration | subprog_spec |
name | name |
name/character_literal | primary_name |
name/operator_symbol | primary_name |
name/simple_name | primary_name |
port_clause | port_clause |
port_map_aspect | map_aspect |
range_constraint | name |
record_constraint | name, paren_expr |
resolution_indication | primary_expr |
selected_name | name |
slice_name | name |
subprogram_body | subprog_spec |
subprogram_declaration | subprog_spec |
subprogram_instantiation_declaration | subprog_spec |
subtype_indication | name, primary_expr |
target | primary_expr |
time_expression | expr |
type_mark | name |
Structs§
Enums§
- Expr
Prec - The precedence of an expression.
Traits§
Functions§
- parse_
alias_ decl - Parse an alias declaration. See IEEE 1076-2008 section 6.6.
- parse_
arch_ body - Parse an architecture body. See IEEE 1076-2008 section 3.3.
- parse_
assert_ stmt - Parse an assertion statement. See IEEE 1076-2008 section 10.3.
- parse_
assign_ dst_ tail - parse_
assign_ tail - 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_
attr_ decl - Parse an attribute declaration or specification. See IEEE 1076-2008 sections 6.7 and 7.2.
- parse_
binding_ ind - 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_
block_ comp_ config - Parse a block or component configuration. See IEEE 1076-2008 sections 3.4.2 and 3.4.3.
- parse_
block_ comp_ decl_ item - Parse a block or component configuration declarative item.
- parse_
block_ comp_ spec - Parse a block or component specification. See IEEE 1067-2008 section 7.3.1.
- parse_
block_ stmt - Parse a block statement. See IEEE 1076-2008 section 11.2.
- parse_
case_ generate_ stmt - Parse a generate case statement. See IEEE 1076-2008 section 11.8.
- parse_
case_ stmt - Parse a case statement. See IEEE 1076-2008 section 10.9.
- parse_
component_ decl - Parse a component declaration. See IEEE 1076-2008 section 6.8.
- parse_
cond_ waves - Parse a list of conditional waveforms. See IEEE 1076-2008 section 10.5.
- parse_
config_ decl - Parse a configuration declaration. See IEEE 1076-2008 section 3.4.
- parse_
config_ spec - Parse a configuration specification. See IEEE 1076-2008 section 7.3.1.
- parse_
context_ decl - Parse a context declaration. IEEE 1076-2008 section 13.3.
- parse_
context_ ref - parse_
design_ file - Parse an entire design file. IEEE 1076-2008 section 13.1.
- parse_
design_ unit - Parse a single design unit. IEEE 1076-2008 section 13.1.
- parse_
discon_ spec - Parse a disconnection specification. See IEEE 1076-2008 section 7.4.
- parse_
entity_ class - Parse an entity class. See IEEE 1076-2008 section 7.2.
- parse_
entity_ decl - Parse an entity declaration. See IEEE 1076-2008 section 3.2.
- parse_
expr - parse_
expr_ prec - Parse an expression with a precedence higher than
prec
. - parse_
expr_ suffix - 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_
for_ generate_ stmt - Parse a generate for statement. See IEEE 1076-2008 section 11.8.
- parse_
generate_ body - Parse a generate body. See IEEE 1076-2008 section 11.8.
- parse_
group_ decl - Parse a group declaration or group template declaration. See IEEE 1076-2008 sections 6.9 and 6.10.
- parse_
if_ generate_ stmt - Parse a generate if statement. See IEEE 1076-2008 section 11.8.
- parse_
if_ stmt - Parse an if statement. See IEEE 1076-2008 section 10.8.
- parse_
inst_ or_ call_ tail - Parse the tail of an instantiation or procedure call statement. See IEEE 1076-2008 sections 10.7, 11.4, and 11.7.
- parse_
intf_ decl - 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_
library_ clause - Parse a library clause. IEEE 1076-2008 section 13.2.
- parse_
loop_ stmt - Parse a loop statement. See IEEE 1076-2008 section 10.10.
- parse_
name - Parse a name. IEEE 1076-2008 section 8.
- parse_
name_ suffix - Parse the suffix to a name. IEEE 1076-2008 section 8.
- parse_
nexit_ stmt - Parse a next or exit statement. See IEEE 1076-2008 sections 10.11 and 10.12.
- parse_
null_ stmt - Parse a null statement. See IEEE 1076-2008 section 10.14.
- parse_
object_ decl - Parse a constant, signal, variable, or file declaration. See IEEE 1076-2008 section 6.4.2.
- parse_
package_ body - Parse a package body. See IEEE 1076-2008 section 4.8.
- parse_
package_ decl - Parse a package declaration. See IEEE 1076-2008 section 4.7.
- parse_
package_ inst - Parse a package instantiation declaration. See IEEE 1076-2008 section 4.9.
- parse_
paren_ elem_ vec - parse_
paren_ expr - 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_
primary_ expr - parse_
proc_ stmt - Parse a process statement. See IEEE 1076-2008 section 11.3.
- parse_
report_ stmt - Parse a report statement. See IEEE 1076-2008 section 10.4.
- parse_
return_ stmt - Parse a return statement. See IEEE 1076-2008 section 10.13.
- parse_
select_ assign - Parse a select assign statement. See IEEE 1076-2008 section 10.5.
- parse_
selected_ waves - Parse a list of selected waveforms. See IEEE 1076-2008 section 10.5.
- parse_
signature - parse_
stmt - Parse a sequential or concurrent statement.
- parse_
subprog_ decl_ item - Parse a subprogram declarative item, which is either a subprogram declaration, body, or instantiation. See IEEE 1076-2008 section 4.2.
- parse_
subprog_ spec - 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_
subtype_ decl - Parse a subtype declaration. See IEEE 1076-2008 section 6.3.
- parse_
subtype_ ind - Parse a subtype indication. See IEEE 1076-2008 section 6.3.
- parse_
type_ decl - Parse a type declaration. See IEEE 1076-2008 section 6.2.
- parse_
use_ clause - Parse a use clause. IEEE 1076-2008 section 12.4.
- parse_
vunit_ binding_ ind - parse_
wait_ stmt - Parse a wait statement. See IEEE 1076-2008 section 10.2.
- parse_
wave - Parse a waveform. See IEEE 1076-2008 section 10.5.
- try_
context_ item - Parse a context item. IEEE 1076-2008 section 13.4.
- try_
decl_ item - Try to parse a declarative item. See IEEE 1076-2008 section 3.2.3.
- try_
delay_ mech - Try to parse a delay mechanism.
- try_
force_ mode - try_
generic_ clause - Try to parse a generic clause. See IEEE 1076-2008 section 6.5.6.2.
- try_
label - 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_
map_ aspect - Try to parse a generic or port map aspect. See IEEE 1076-2008 sections 6.5.7.2 and 6.5.7.3.
- try_
name - Try to parse a name. IEEE 1076-2008 section 8.
- try_
name_ or_ qualified_ primary_ expr - try_
paren_ expr - try_
port_ clause - Try to parse a port clause. See IEEE 1076-2008 section 6.5.6.3.
- try_
primary_ name - Try to parse a primary name. IEEE 1076-2008 section 8.