summaryrefslogtreecommitdiff
path: root/support/ltx2x/licomsym.h
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /support/ltx2x/licomsym.h
Initial commit
Diffstat (limited to 'support/ltx2x/licomsym.h')
-rw-r--r--support/ltx2x/licomsym.h175
1 files changed, 175 insertions, 0 deletions
diff --git a/support/ltx2x/licomsym.h b/support/ltx2x/licomsym.h
new file mode 100644
index 0000000000..eb1b39adcf
--- /dev/null
+++ b/support/ltx2x/licomsym.h
@@ -0,0 +1,175 @@
+/* licomsym.h Symbol table common for sharing between LTX2X & code interp */
+
+#ifndef licomsym_h
+#define licomsym_h
+
+#include "l2xicmon.h"
+
+/* value structure */
+typedef union {
+ XPRSAINT integer;
+ XPRSAREAL real;
+ char character;
+ char *stringp;
+} VALUE;
+
+/* definition structure */
+
+typedef enum {
+#define dfntc(a, b) a,
+#include "l2xidftc.h"
+#undef dfntc
+} DEFN_KEY;
+
+
+
+typedef enum {
+ DECLARED,
+ FORWARD,
+ READ,
+ READLN,
+ WRITE,
+ WRITELN,
+ ABS,
+ COS,
+ EOFF,
+ EOLN,
+ EXP,
+ ODD,
+ ROUND,
+ SIN,
+ SQRT,
+ TRUNC,
+ L2XPRINT,
+ L2XPRINTLN,
+ L2XSYSTEM,
+ L2XREXPR,
+ XACOS,
+ XASIN,
+ XATAN,
+ XBLENGTH,
+ XEXISTS,
+ XFORMAT,
+ XHIBOUND,
+ XHIINDEX,
+ XLENGTH,
+ XLOBOUND,
+ XLOG,
+ XLOG2,
+ XLOG10,
+ XLOINDEX,
+ XNVL,
+ XROLESOF,
+ XSIZEOF,
+ XTAN,
+ XTYPEOF,
+ XUSEDIN,
+ XVALUE,
+ XVALUE_IN,
+ XVALUE_UNIQUE,
+ XINSERT,
+ XREMOVE,
+} ROUTINE_KEY;
+
+typedef struct {
+ DEFN_KEY key;
+ union {
+ struct {
+ VALUE value;
+ } constant;
+
+ struct {
+ ROUTINE_KEY key;
+ int parm_count;
+ int total_parm_size;
+ int total_local_size;
+ struct symtab_node *parms;
+ struct symtab_node *locals;
+ struct symtab_node *local_symtab;
+ ICT *code_segment;
+ } routine;
+
+ struct {
+ int offset;
+ struct symtab_node *entity_idp;
+ } data;
+ } info;
+} DEFN_STRUCT;
+
+/* type structure */
+
+typedef enum {
+#define fotc(a, b, c, d) c,
+#define sotc(a, b, c, d)
+#define sftc(a, b, c, d) c,
+#include "l2xisftc.h"
+#undef fotc
+#undef sotc
+#undef sftc
+} TYPE_FORM;
+
+typedef struct type_struct {
+ TYPE_FORM form;
+ int size;
+ struct symtab_node *type_idp;
+ union {
+ struct {
+ struct symtab_node *const_idp;
+ int max;
+ } enumeration;
+
+ struct {
+ struct type_struct *range_typep;
+ int min;
+ int max;
+ } subrange;
+
+ struct {
+ struct type_struct *bound_typep;
+ int min;
+ int max;
+ } bound;
+
+ struct {
+ struct type_struct *index_typep;
+ struct type_struct *elmt_typep;
+ int min_index;
+ int max_index;
+ int elmt_count;
+ } array;
+
+ struct {
+ struct type_struct *index_typep;
+ struct type_struct *elmt_typep;
+ int min_index;
+ int max_index;
+ int elmt_count;
+ } dynagg;
+
+ struct {
+ struct symtab_node *attribute_symtab;
+ } entity;
+
+ struct {
+ int max_length;
+ int length;
+ } string;
+ } info;
+} TYPE_STRUCT, *TYPE_STRUCT_PTR;
+
+/* symbol table node */
+typedef struct symtab_node {
+ struct symtab_node *left, *right; /* ptrs to subtrees */
+ struct symtab_node *next; /* for chaining nodes */
+ char *name; /* name string */
+ char *info; /* ptr to generic info */
+ DEFN_STRUCT defn; /* definition struct */
+ TYPE_STRUCT_PTR typep; /* ptr to type struct */
+ int level; /* nesting level */
+ int label_index; /* index for code label */
+} SYMTAB_NODE, *SYMTAB_NODE_PTR;
+
+typedef int LOGICAL_REP;
+
+#endif
+