Verilog Parser

Represents nodes at the very top of the source tree. More...

Data Structures

struct  ast_node
 Node type that forms the tree. More...
 
struct  ast_source_item
 Contains a source item and it's type. More...
 
struct  verilog_source_tree
 Top level container for parsed source code. More...
 

Enumerations

enum  ast_node_type {
  ATTRIBUTE_LIST, EXPRESSION, IDENTIFIER, MODULE,
  NONE
}
 Enum type describing the data value that an AST node holds. More...
 
enum  ast_source_item_type { SOURCE_MODULE = 0, SOURCE_UDP = 1 }
 Describes the type of a item in the list of source entries. More...
 

Functions

ast_source_itemast_new_source_item (ast_source_item_type type)
 Creates and returns a new source item representation. More...
 
ast_node * ast_node_new ()
 Creates a new empty ast_node and returns it. More...
 
void verilog_free_source_tree (verilog_source_tree *tofree)
 Releases a source tree object from memory. More...
 
verilog_source_treeverilog_new_source_tree ()
 Creates and returns a new, empty source tree. More...
 

Variables

verilog_source_treeyy_verilog_source_tree
 This is where we put all of the parsed constructs. More...
 

Detailed Description

Represents nodes at the very top of the source tree.

These nodes won't always correspond to a syntactic construct, and are used to represent a collection of other nodes.

Enumeration Type Documentation

Enum type describing the data value that an AST node holds.

Deprecated:
The AST Node was only ever temporary, don't add new stuff with it.
Enumerator
ATTRIBUTE_LIST 

A design attribute. ast_node_attributes_t.

EXPRESSION 

A constant or variable expression.

NONE 

The node has no stored data type.

Describes the type of a item in the list of source entries.

Enumerator
SOURCE_MODULE 

Refers to a module definition.

SOURCE_UDP 

A User Defined Primitive (UDP) Declaration.

Function Documentation

ast_source_item* ast_new_source_item ( ast_source_item_type  type)

Creates and returns a new source item representation.

Parameters
[in]type- The type of the source item to be represented.
Note
Expects the union member of the returned ast_source_item to be set manually.
ast_node* ast_node_new ( )

Creates a new empty ast_node and returns it.

Deprecated:
The AST Node was only ever temporary, don't add new stuff with it.
void verilog_free_source_tree ( verilog_source_tree tofree)

Releases a source tree object from memory.

Frees the top level source tree object, and all of it's child ast_* objects by calling the ast_free_all function.

Parameters
[in]tofree- The source tree to be free'd
[in]tofree- The source tree to be free'd
verilog_source_tree* verilog_new_source_tree ( )

Creates and returns a new, empty source tree.

This should be called ahead of parsing anything, so we will have an object to put parsed constructs into.

Variable Documentation

verilog_source_tree* yy_verilog_source_tree

This is where we put all of the parsed constructs.

This is where we put all of the parsed constructs.

This is a global variable, initialised prior to calling the verilog_parse function, into which all objects the parser finds are stored.