Skip to content

Commit

Permalink
Massive documentation update and re-structure.
Browse files Browse the repository at this point in the history
- Finally grouped documentation into sensible module sections.
- Added sub-modules for all AST generation functions.
- Need to add a separate module for describing the AST grammar.
 On branch master
 Your branch is up-to-date with 'github/master'.

 Changes to be committed:
	modified:   ../docs/Doxyfile
	new file:   ../docs/ast-construction.dox
	new file:   ../docs/ast-nodes.dox
	new file:   ../docs/ast-structure.dox
	modified:   ../docs/ast.dox
	modified:   ../src/verilog_ast.h
  • Loading branch information
ben-marshall committed May 30, 2016
1 parent 753f73c commit 5bfeb98
Show file tree
Hide file tree
Showing 6 changed files with 394 additions and 88 deletions.
2 changes: 1 addition & 1 deletion docs/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
DISTRIBUTE_GROUP_DOC = YES
SUBGROUPING = YES
INLINE_GROUPED_CLASSES = NO
INLINE_SIMPLE_STRUCTS = NO
Expand Down
13 changes: 13 additions & 0 deletions docs/ast-construction.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*!
@defgroup ast-construction AST Construction Functions
@ingroup ast

@brief This page describes all of the functions used to construct the AST
representation of the input code, along with the corresponding data
structures.

@details
All functions and data structures are grouped depending on which syntactic
feature of the language you are trying to represent.

*/
52 changes: 52 additions & 0 deletions docs/ast-nodes.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
/*!
@defgroup ast-nodes AST Nodes
@ingroup ast

@brief This section contains a list of all grammar constructs and data
structures that have yet to be written and integrated.

- Attribute Instances [DONE]
- Expression L-Values [DONE]
- Expression R-Values [DONE]
- Expression Primaries [DONE]
- Constant Expressions [DONE]
- Variable Expressions [DONE]
- Proper Number Representation
- Function Calls [DONE]
- Concatenations [DONE]
- Path Delays
- Specify Blocks
- Statements
- Loops
- Case
- If Else
- Timing Control
- Fork Join
- Procedural Blocks
- Continous assignments
- UDP
- UDP Instance
- UDP Port
- UDP Body
- Generate Loops
- Module Instantiation
- Primitives
- Terminals
- Strengths
- Switch Types
- Task Declaration
- Function Declaration
- Declaration Assignments
- Delays
- Drive Strenghts
- Nets
- Modules
- Ports
- Module Paramaters
- Module Items
- Configuration Source Text
- Library Source Text
- Compiler Directives
- Top Level

*/
15 changes: 15 additions & 0 deletions docs/ast-structure.dox
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*!

@defgroup ast-structure AST Structure
@ingroup ast

@brief Describes the main structure of the tree, and how node parentage is
represented.

@todo Document all of this.

The AST constructed by the parser has the following structure:

TBD!!

*/
78 changes: 2 additions & 76 deletions docs/ast.dox
Original file line number Diff line number Diff line change
@@ -1,83 +1,9 @@
/*!
@page doc-ast Abstract Syntax Tree

@defgroup ast Abstract Syntax Tree

This page describes the structure of the abstract syntax tree that the
parser constructs. It includes the various root nodes, and how their
child nodes are structured.

@tableofcontents

---

@section doc-top-node Tree Structure

The AST constructed by the parser has the following structure:

- The tree is constructed with identical nodes of type @ref ast_node_t
- Each node has a single parent and zero or more children. These pointers
form the basis of the tree.
- Only the root node can have no parent, in which case, this member is set
to NULL.
- Each node has corresponding `data` and `type` members. The type member
tells us what sort of data the node holds, while the data member is a
union, which can store any of the required objects. Child nodes should
never be stored in the data member.

Each node also has lineno and file members. These tell us the line number
and file path where the source code which gave us the node came from.

Traversal of the tree can therefore be done using a single expected data type,
rather than having lots of different types of node which we might otherwise
need to typecast to traverse easily.

@section ast-todo Nodes To Do

@todo AST Nodes.
This section contains a list of all grammar constructs and data structures
that have yet to be written and integrated.

- Attribute Instances [DONE]
- Expression L-Values [DONE]
- Expression R-Values [DONE]
- Expression Primaries [DONE]
- Constant Expressions [DONE]
- Variable Expressions [DONE]
- Proper Number Representation
- Function Calls [DONE]
- Concatenations
- Path Delays
- Specify Blocks
- Statements
- Loops
- Case
- If Else
- Timing Control
- Fork Join
- Procedural Blocks
- Continous assignments
- UDP
- UDP Instance
- UDP Port
- UDP Body
- Generate Loops
- Module Instantiation
- Primitives
- Terminals
- Strengths
- Switch Types
- Task Declaration
- Function Declaration
- Declaration Assignments
- Delays
- Drive Strenghts
- Nets
- Modules
- Ports
- Module Paramaters
- Module Items
- Configuration Source Text
- Library Source Text
- Compiler Directives
- Top Level

*/
Loading

0 comments on commit 5bfeb98

Please sign in to comment.