PCCTSAST.h revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
/* Abstract syntax tree
*
* SOFTWARE RIGHTS
*
* We reserve no LEGAL rights to the Purdue Compiler Construction Tool
* Set (PCCTS) -- PCCTS is in the public domain. An individual or
* company may do whatever they wish with source code distributed with
* PCCTS or the code generated by PCCTS, including the incorporation of
* PCCTS, or its output, into commerical software.
*
* We encourage users to develop software with PCCTS. However, we do ask
* that credit is given to us for developing PCCTS. By "credit",
* we mean that if you incorporate our source code into one of your
* programs (commercial product, research project, or otherwise) that you
* acknowledge this fact somewhere in the documentation, research report,
* etc... If you like PCCTS and have developed a nice tool with the
* output, please mention that you developed it using PCCTS. In
* addition, we ask that this header remain intact in our source code.
* As long as these guidelines are kept, we expect to continue enhancing
* this system and expect to make other tools available as they are
* completed.
*
* ANTLR 1.33
* Terence Parr
* Parr Research Corporation
* with Purdue University and AHPCRC, University of Minnesota
* 1989-2000
*/
#ifndef PCCTSAST_H
#define PCCTSAST_H
#include "pcctscfg.h"
#include "pccts_stdio.h"
#include "pccts_stdlib.h"
//class SList;
#define StringScanMaxText 50
#define MaxTreeStackDepth 400
//
// 7-Apr-97 133MR1 signed int not accepted by AT&T cfront
//
typedef struct stringlexer {
int c; // MR1
char *input;
char *p;
char text[StringScanMaxText];
} StringLexer;
/* Define the structures needed for ast_scan() */
typedef struct stringparser {
int token;
int num_labels;
} StringParser;
typedef struct _scanast {
int _token;
int label_num;
} ScanAST;
static const char *scan_token_tbl[]; /* MR20 const */
enum {
__LPAREN=1,
__RPAREN=2,
__PERCENT=3,
__INT=4,
__COLON=5,
__POUND=6,
__PERIOD=7,
__StringScanEOF=-1};
const char *scan_token_str(int t); /* MR20 const */
void scanast_free(ScanAST *t);
PCCTS_AST() {;}
/* This group must be defined for SORCERER to work correctly */
// we define these so ANTLR doesn't have to
/* These are not needed by ANTLR, but are support functions */
// virtual SList *to_slist();
};
#endif /* PCCTSAST_H */