mlc Namespace Reference

Classes

class  abstract_symbol
 abstract symbol representation More...
class  abstract_type
 abstract entry for a type More...
class  array_type
 entry for an (one-dimensional) array type More...
class  bool_const_symbol
 representation of a named boolean constant More...
class  bool_type
 entry for the 'boolean' type (singleton) More...
class  const_symbol
 common base of all named constant representations More...
class  field_entry
 record field More...
class  field_list
 list of record fields More...
class  function_symbol
 representation of a function More...
class  global_variable_symbol
 global variable representation More...
class  int_const_symbol
 representation of a named integer constant More...
class  int_type
 entry for the 'integer' type (singleton) More...
class  integral_type
 common base for integer and range type entries More...
class  label_entry
class  label_symbol
 label entry More...
class  local_symbol_tables
class  local_variable_symbol
 local variable representation More...
class  ls_index_comparator
struct  MlaskalCtx
 structure for DU6 bison context More...
class  parameter_by_reference_symbol
 representation of a parameter passed by reference ('var') More...
struct  parameter_entry
 function or procedure parameter entry More...
class  parameter_list
 list of function or procedure parameters More...
class  procedure_symbol
 representation of a procedure More...
class  range_type
 entry for a range type More...
class  real_const_symbol
 representation of a named real constant More...
class  real_type
 entry for the 'real' type (singleton) More...
class  record_type
 entry for a record type More...
class  str_const_symbol
 representation of a named string constant More...
class  str_type
 entry for the 'string' type (singleton) More...
class  subprogram_symbol
 common base of procedure and function entries More...
class  symbol_entry
class  symbol_tables
 all symbol tables together More...
class  type_entry
class  type_symbol
 representation of a named type More...
class  typed_symbol
 common base of all symbol entries that have a type More...
class  variable_symbol
 common base of all variable representations More...

Typedefs

typedef mlaskal::dumb_pointer
< array_type
array_type_pointer
 pointer to an array_type entry
typedef mlaskal::dumb_pointer
< bool_const_symbol
bool_const_symbol_pointer
 pointer to a representation of a named boolean constant
typedef mlaskal::dumb_pointer
< bool_type
bool_type_pointer
 pointer to an bool_type entry
typedef mlaskal::dumb_pointer
< const_symbol
const_symbol_reference
 pointer to const_symbol entry
typedef mlaskal::dumb_pointer
< const field_entry
field_pointer
 pointer to an field_entry
typedef std::vector< field_entryfield_vector
typedef mlaskal::dumb_pointer
< function_symbol
function_symbol_pointer
 pointer to function_symbol entry
typedef mlaskal::dumb_pointer
< global_variable_symbol
global_variable_symbol_pointer
 pointer to global_variable_symbol entry
typedef
mlaskal::abstract_functions::iterator 
ic_function_pointer
 intermediate code label
typedef
mlaskal::labeled_icblock::label_type 
ic_label
 intermediate code label
typedef mlaskal::labeled_icblock * icblock_pointer
 intermediate code block
typedef mlaskal::dumb_pointer
< int_const_symbol
int_const_symbol_pointer
 pointer to a representation of a named integer constant
typedef mlaskal::dumb_pointer
< int_type
int_type_pointer
 pointer to an int_type entry
typedef std::map< ls_int_index,
label_entry,
ls_index_comparator< int > > 
label_map
typedef mlaskal::dumb_pointer
< label_symbol
label_symbol_pointer
 pointer to a label entry
typedef mlaskal::dumb_pointer
< local_variable_symbol
local_variable_symbol_pointer
 pointer to local_variable_symbol entry
typedef ls_id_type::const_iterator ls_id_index
 identifier index
typedef mlaskal::lit_storage
< std::string > 
ls_id_type
 identifier storage type
typedef ls_int_type::const_iterator ls_int_index
 integer literal index
typedef mlaskal::lit_storage< int > ls_int_type
 integer literal storage type
typedef
ls_real_type::const_iterator 
ls_real_index
 real literal index
typedef mlaskal::lit_storage
< double > 
ls_real_type
 real literal storage type
typedef ls_str_type::const_iterator ls_str_index
 string literal index
typedef mlaskal::lit_storage
< std::string > 
ls_str_type
 string literal storage type
typedef mlaskal::dumb_pointer
< parameter_by_reference_symbol
parameter_by_reference_symbol_pointer
 pointer to parameter_by_reference_symbol entry
typedef std::vector
< parameter_entry
parameter_vector
typedef mlaskal::dumb_pointer
< procedure_symbol
procedure_symbol_pointer
 pointer to procedure_symbol entry
typedef mlaskal::dumb_pointer
< range_type
range_type_pointer
 pointer to an range_type entry
typedef mlaskal::dumb_pointer
< real_const_symbol
real_const_symbol_pointer
 pointer to a representation of a named real constant
typedef mlaskal::dumb_pointer
< real_type
real_type_pointer
 pointer to an real_type entry
typedef std::map< ls_id_index,
const field_entry
*, ls_index_comparator
< std::string > > 
record_cache_type
typedef mlaskal::dumb_pointer
< record_type
record_type_pointer
 pointer to a record_type entry
typedef mlaskal::ICRELNUM stack_address
 stack offset type
typedef mlaskal::dumb_pointer
< str_const_symbol
str_const_symbol_pointer
 pointer to a representation of a named string constant
typedef mlaskal::dumb_pointer
< str_type
str_type_pointer
 pointer to an str_type entry
typedef mlaskal::dumb_pointer
< subprogram_symbol
subprogram_symbol_pointer
 pointer to subprogram_symbol entry
typedef std::map< ls_id_index,
symbol_entry,
ls_index_comparator
< std::string > > 
symbol_map
typedef mlaskal::dumb_pointer
< abstract_symbol
symbol_pointer
 pointer to abstract symbol entry
typedef mlaskal::dumb_pointer
< abstract_type
type_pointer
 pointer to representation of a type
typedef mlaskal::dumb_pointer
< type_symbol
type_symbol_reference
 pointer to type_symbol entry
typedef std::list< type_entrytype_vector
typedef mlaskal::dumb_pointer
< typed_symbol
typed_symbol_pointer
 pointer to typed_symbol entry
typedef mlaskal::dumb_pointer
< variable_symbol
variable_symbol_pointer
 pointer to variable_symbol entry

Enumerations

enum  err_code {
  DUERR_OK, DUERR_NOK, DUERR_ERRS, DUERR_WARNING = 1000,
  DUERR_INTOUTRANGE, DUERR_REALOUTRANGE, DUERR_CONVERSION, DUERR_NOLABELUSE,
  DUERR_NOLABELGOTO, DUERR_SEMWARN = 2000, DUERR_ERROR = 5000, DUERR_UNKCHAR,
  DUERR_EOFINCMT, DUERR_EOLINSTRCHR, DUERR_EOFINSTRCHR, DUERR_UNEXPENDCMT,
  DUERR_BADINT, DUERR_BADREAL, DUERR_SYNTAX, DUERR_SEMERROR = 6000,
  DUERR_DUPSYM, DUERR_DUPLABEL, DUERR_NOTTYPE, DUERR_NOTORDINAL,
  DUERR_NOTLABEL, DUERR_NOTMINE, DUERR_NOTLVALUE, DUERR_NOTPARAMVAR,
  DUERR_TYPEMISMATCH, DUERR_NOTPROC, DUERR_NOTARRAY, DUERR_NOTSCALAR,
  DUERR_PARNUM, DUERR_NOTVAR, DUERR_NOTFNC, DUERR_NOTCONST,
  DUERR_NOTINTEGRAL, DUERR_CANNOTCONVERT, DUERR_FORNOTLOCAL, DUERR_FORNOTINTEGER,
  DUERR_BADRANGE, DUERR_DUPLABELDEF, DUERR_MISLABELDEF, DUERR_FATAL = 10000,
  DUERR_NOINFILE, DUERR_NOOUTFILE
}
enum  parameter_mode { PMODE_UNDEF, PMODE_BY_VALUE, PMODE_BY_REFERENCE }
 

function or procedure parameter modes

More...
enum  symbol_kind {
  SKIND_UNDEF, SKIND_PROCEDURE, SKIND_FUNCTION, SKIND_GLOBAL_VARIABLE,
  SKIND_LOCAL_VARIABLE, SKIND_PARAMETER_BY_REFERENCE, SKIND_TYPE, SKIND_CONST
}
 

symbol kind

More...
enum  type_category {
  TCAT_UNDEF, TCAT_ARRAY, TCAT_RECORD, TCAT_BOOL,
  TCAT_RANGE, TCAT_INT, TCAT_REAL, TCAT_STR
}
 

category of a type

More...

Functions

field_listcreate_field_list ()
 creates an empty field list
parameter_listcreate_parameter_list ()
 creates an empty parameter list
void icblock_append_delete (icblock_pointer dicb, icblock_pointer sicb)
 merges two icblocks
icblock_pointer icblock_create ()
 creates empty icblock
bool identical_type (type_pointer a, type_pointer b)
 compares two types
ic_label new_label (MlaskalCtx *)
 generates unique intermediate code label
std::ostream & operator<< (std::ostream &o, const parameter_list &e)
std::ostream & operator<< (std::ostream &o, const parameter_entry &e)
std::ostream & operator<< (std::ostream &o, const field_entry &e)
std::ostream & operator<< (std::ostream &o, const type_entry &e)
std::ostream & operator<< (std::ostream &os, type_category typecat)
int symtab_postprocess (struct MlaskalCtx *ctx, const std::string &dump_fname)
 destroys the symbol tables
int symtab_preprocess (struct MlaskalCtx *ctx, bool debug)
 creates the symbol tables

Typedef Documentation

typedef mlaskal::dumb_pointer< array_type> mlc::array_type_pointer

pointer to an array_type entry

typedef mlaskal::dumb_pointer< bool_const_symbol> mlc::bool_const_symbol_pointer

pointer to a representation of a named boolean constant

typedef mlaskal::dumb_pointer< bool_type> mlc::bool_type_pointer

pointer to an bool_type entry

typedef mlaskal::dumb_pointer< const_symbol> mlc::const_symbol_reference

pointer to const_symbol entry

typedef mlaskal::dumb_pointer< const field_entry> mlc::field_pointer

pointer to an field_entry

typedef std::vector< field_entry > mlc::field_vector

For internal use only.

parameter entry vector

typedef mlaskal::dumb_pointer< function_symbol> mlc::function_symbol_pointer

pointer to function_symbol entry

pointer to global_variable_symbol entry

typedef mlaskal::abstract_functions::iterator mlc::ic_function_pointer

intermediate code label

typedef mlaskal::labeled_icblock::label_type mlc::ic_label

intermediate code label

typedef mlaskal::labeled_icblock* mlc::icblock_pointer

intermediate code block

typedef mlaskal::dumb_pointer< int_const_symbol> mlc::int_const_symbol_pointer

pointer to a representation of a named integer constant

typedef mlaskal::dumb_pointer< int_type> mlc::int_type_pointer

pointer to an int_type entry

For internal use only.

label map

typedef mlaskal::dumb_pointer< label_symbol> mlc::label_symbol_pointer

pointer to a label entry

pointer to local_variable_symbol entry

typedef ls_id_type::const_iterator mlc::ls_id_index

identifier index

typedef mlaskal::lit_storage<std::string> mlc::ls_id_type

identifier storage type

typedef ls_int_type::const_iterator mlc::ls_int_index

integer literal index

typedef mlaskal::lit_storage<int> mlc::ls_int_type

integer literal storage type

typedef ls_real_type::const_iterator mlc::ls_real_index

real literal index

typedef mlaskal::lit_storage<double> mlc::ls_real_type

real literal storage type

typedef ls_str_type::const_iterator mlc::ls_str_index

string literal index

typedef mlaskal::lit_storage<std::string> mlc::ls_str_type

string literal storage type

typedef std::vector< parameter_entry> mlc::parameter_vector

For internal use only.

parameter entry vector

typedef mlaskal::dumb_pointer< procedure_symbol> mlc::procedure_symbol_pointer

pointer to procedure_symbol entry

typedef mlaskal::dumb_pointer< range_type> mlc::range_type_pointer

pointer to an range_type entry

typedef mlaskal::dumb_pointer< real_const_symbol> mlc::real_const_symbol_pointer

pointer to a representation of a named real constant

typedef mlaskal::dumb_pointer< real_type> mlc::real_type_pointer

pointer to an real_type entry

typedef std::map< ls_id_index, const field_entry *, ls_index_comparator< std::string> > mlc::record_cache_type

For internal use only.

record field index

typedef mlaskal::dumb_pointer< record_type> mlc::record_type_pointer

pointer to a record_type entry

typedef mlaskal::ICRELNUM mlc::stack_address

stack offset type

this type is used to store addresses of global and local variables

typedef mlaskal::dumb_pointer< str_const_symbol> mlc::str_const_symbol_pointer

pointer to a representation of a named string constant

typedef mlaskal::dumb_pointer< str_type> mlc::str_type_pointer

pointer to an str_type entry

typedef mlaskal::dumb_pointer< subprogram_symbol> mlc::subprogram_symbol_pointer

pointer to subprogram_symbol entry

typedef std::map< ls_id_index, symbol_entry, ls_index_comparator< std::string> > mlc::symbol_map

For internal use only.

symbol map

typedef mlaskal::dumb_pointer< abstract_symbol> mlc::symbol_pointer

pointer to abstract symbol entry

typedef mlaskal::dumb_pointer< abstract_type> mlc::type_pointer

pointer to representation of a type

typedef mlaskal::dumb_pointer< type_symbol> mlc::type_symbol_reference

pointer to type_symbol entry

typedef std::list< type_entry> mlc::type_vector

For internal use only.

vector of type entries

typedef mlaskal::dumb_pointer< typed_symbol> mlc::typed_symbol_pointer

pointer to typed_symbol entry

typedef mlaskal::dumb_pointer< variable_symbol> mlc::variable_symbol_pointer

pointer to variable_symbol entry


Enumeration Type Documentation

Enumerator:
DUERR_OK 
DUERR_NOK 
DUERR_ERRS 
DUERR_WARNING 
DUERR_INTOUTRANGE 
DUERR_REALOUTRANGE 
DUERR_CONVERSION 

conversion of real to integer

DUERR_NOLABELUSE 

label declared but never used

DUERR_NOLABELGOTO 

label declared but never jumped

DUERR_SEMWARN 
DUERR_ERROR 
DUERR_UNKCHAR 
DUERR_EOFINCMT 
DUERR_EOLINSTRCHR 
DUERR_EOFINSTRCHR 
DUERR_UNEXPENDCMT 
DUERR_BADINT 
DUERR_BADREAL 
DUERR_SYNTAX 
DUERR_SEMERROR 
DUERR_DUPSYM 

symbol %s already declared (in the same scope)

DUERR_DUPLABEL 

label %d already declared (in the same scope)

DUERR_NOTTYPE 

symbol %d does not denote a type

DUERR_NOTORDINAL 

type is not a range

DUERR_NOTLABEL 

label %d is not declared

DUERR_NOTMINE 

assigning return value to another function %s

DUERR_NOTLVALUE 

not an l-value on the left of :=

DUERR_NOTPARAMVAR 

actual of a parameter passed by reference is not an object

DUERR_TYPEMISMATCH 

type mismatch in a parameter passed by reference

DUERR_NOTPROC 

calling non-procedure symbol %s

DUERR_NOTARRAY 

subscript operator applied to non-array symbol %s

DUERR_NOTSCALAR 

function return type %s is not a scalar

DUERR_PARNUM 

wrong number of actual parameters in call to %s

DUERR_NOTVAR 

symbol %s is not a variable, constant or function

DUERR_NOTFNC 

symbol %s is not a function

DUERR_NOTCONST 

symbol %s is not a constant

DUERR_NOTINTEGRAL 

symbol %s is not an integral constant

DUERR_CANNOTCONVERT 

incompatible operand, parameter or assigned value

DUERR_FORNOTLOCAL 

for-loop control variable %s is not a variable

DUERR_FORNOTINTEGER 

for-loop control variable %s is not integral

DUERR_BADRANGE 

Invalid range definition (lower > upper)

DUERR_DUPLABELDEF 

label defined twice

DUERR_MISLABELDEF 

label jumped but not defined

DUERR_FATAL 
DUERR_NOINFILE 
DUERR_NOOUTFILE 

function or procedure parameter modes

Enumerator:
PMODE_UNDEF 
PMODE_BY_VALUE 
PMODE_BY_REFERENCE 

symbol kind

Enumerator:
SKIND_UNDEF 
SKIND_PROCEDURE 
SKIND_FUNCTION 
SKIND_GLOBAL_VARIABLE 
SKIND_LOCAL_VARIABLE 
SKIND_PARAMETER_BY_REFERENCE 
SKIND_TYPE 
SKIND_CONST 

category of a type

Enumerator:
TCAT_UNDEF 
TCAT_ARRAY 
TCAT_RECORD 
TCAT_BOOL 
TCAT_RANGE 
TCAT_INT 
TCAT_REAL 
TCAT_STR 

Function Documentation

field_list* mlc::create_field_list (  ) 

creates an empty field list

parameter_list* mlc::create_parameter_list (  ) 

creates an empty parameter list

void mlc::icblock_append_delete ( icblock_pointer  dicb,
icblock_pointer  sicb 
) [inline]

merges two icblocks

appends sicb to dicb, kills sicb

icblock_pointer mlc::icblock_create (  )  [inline]

creates empty icblock

bool mlc::identical_type ( type_pointer  a,
type_pointer  b 
)

compares two types

returns true if types are identical wrt. Mlaskal rules

ic_label mlc::new_label ( MlaskalCtx *   )  [inline]

generates unique intermediate code label

std::ostream& mlc::operator<< ( std::ostream &  o,
const parameter_list &  e 
)

For internal use only.

parameter list dumper

std::ostream& mlc::operator<< ( std::ostream &  o,
const parameter_entry &  e 
)

For internal use only.

parameter entry dumper

std::ostream& mlc::operator<< ( std::ostream &  o,
const field_entry &  e 
)

For internal use only.

parameter entry dumper

std::ostream& mlc::operator<< ( std::ostream &  o,
const type_entry &  e 
)

For internal use only.

type_entry dumper

std::ostream& mlc::operator<< ( std::ostream &  os,
type_category  typecat 
)

For internal use only.

type_category dumper

int mlc::symtab_postprocess ( struct MlaskalCtx *  ctx,
const std::string &  dump_fname 
)

destroys the symbol tables

will be called after the parser has finished

returns 0, if OK; otherwise !=0

int mlc::symtab_preprocess ( struct MlaskalCtx *  ctx,
bool  debug 
)

creates the symbol tables

will be called before the parser is started

returns 0, if OK; otherwise !=0


Generated on Wed Nov 25 10:18:00 2009 for DU4 support classes by  doxygen 1.6.1