trick/trick_source/sim_services/MemoryManager/ADefParseContext.cpp
Alex Lin 19025d77ad Standardize directory names
Reorganized.  Created a new top level include directory that will hold all of Trick's header files. Moved all of the Trick headers to this directory.  Created a libexec directory that holds all of the executables that users don't need to execute directly.  Changed all of the executables remaining in bin to start with "trick-".  In the sim_services directories changed all source files to find the Trick headers in their new location.  Since all of the include files are gone in sim_services, removed the src directories as well, moving all of the source files up a level.  Moved the makefiles, docs, man, and other architecture independent files into a top level share directory.  Renamed lib_${TRICK_HOST_CPU} to lib64 or lib depending on the platform we're currently on.

refs #63
2015-06-09 08:44:42 -05:00

84 lines
2.2 KiB
C++

/**
@page ADEF_Syntax Allocation Declaration Syntax
An allocation declaration string is used to declare type information for a chunk of memory.
They are taken as parameters by the Memory Managers's declare_var and declare_ext_var member
functions as well as "C" interface calls TMM_declare_var_s and TMM_declare_ext_var_s.
An allocation declaration is an intrinsic type or a user-defined-type followed by a declarator.
A declarator is zero or more asterisks (pointers), followed by an optional variable name,
followed by zero or more bracketed integers (a dimension list).
An intrinsic type is one of the "built-in" types, like "char", "int", "double", etc.
A user defined type is a typedef-struct name or a class name, including if necessary, scope resolution operators ( i.e., "::").
Example Allocation Declaration strings:
- "double"
- "double[3]"
- "double*[3]"
- "char[3][4]"
- "int narf"
- "int *baz[3]"
- "VEHICLE truck"
- "FOO::BAR zortz[2][5]"
\b Syntax of an Allocation Declaration String:
@verbatim
<alloc-declaration> ::= <intrinsic-type> <declarator>
| <user-defined-type> <declarator>
<declarator> ::= <pointers> <opt-name> <dim-list>
<opt-name> ::= nil
| NAME
<pointers> ::= nil
| pointers '*'
<user-defined-type> ::= NAME
| <user-defined-type> ":" ":" NAME
<dim-list> ::= nil
| <dim-list> "[" INTEGER "]"
intrinsic_type ::= "char"
| "short"
| "int"
| "long"
| "float"
| "double"
| "long long"
| "wchar_t"
| "unsigned char"
| "unsigned short"
| "unsigned int"
| "unsigned long"
| "unsigned long long"
NAME ::= [_a-zA-Z][_a-zA-Z0-9:]*
@endverbatim
*/
#include <stdio.h>
#include <stdlib.h>
#include "trick/ADefParseContext.hh"
/**
Constructor
*/
Trick::ADefParseContext::ADefParseContext( std::istream* in_is ) {
init_scanner();
this->is = in_is;
}
/**
Destructor
*/
Trick::ADefParseContext::~ADefParseContext() {
destroy_scanner();
}