Skip to content

Commit

Permalink
C and C++ targets converted from tabs to spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
phorward committed Oct 28, 2023
1 parent 885ab6e commit 0b1c021
Show file tree
Hide file tree
Showing 49 changed files with 9,815 additions and 9,872 deletions.
8,774 changes: 4,387 additions & 4,387 deletions src/parse.c

Large diffs are not rendered by default.

173 changes: 86 additions & 87 deletions src/parse.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Parser header generated by unicc from src/parse.par.
DO NOT EDIT THIS FILE MANUALLY, IT WILL GO AWAY!
Parser header generated by unicc from parse.par.
DO NOT EDIT THIS FILE MANUALLY, IT WILL GO AWAY!
*/

#ifndef PARSE_H
Expand Down Expand Up @@ -63,9 +63,9 @@
/* Parse error macro */
#ifndef UNICC_PARSE_ERROR
#define UNICC_PARSE_ERROR( pcb ) \
fprintf( stderr, "line %d, column %d: syntax error on symbol %d, token '" \
UNICC_SCHAR_FORMAT "'\n", \
( pcb )->line, ( pcb )->column, pcb->sym, _lexem( pcb ) )
fprintf( stderr, "line %d, column %d: syntax error on symbol %d, token '" \
UNICC_SCHAR_FORMAT "'\n", \
( pcb )->line, ( pcb )->column, pcb->sym, _lexem( pcb ) )
#endif

/* Input buffering clean-up */
Expand All @@ -86,8 +86,8 @@
/* Call this when running out of memory during memory allocation */
#ifndef UNICC_OUTOFMEM
#define UNICC_OUTOFMEM( pcb ) fprintf( stderr, \
"Fatal error, ran out of memory\n" ), \
exit( 1 )
"Fatal error, ran out of memory\n" ), \
exit( 1 )
#endif

/* Static switch */
Expand Down Expand Up @@ -127,119 +127,118 @@
/* Value Types */
typedef union _VTYPE
{
char* value_0;
BOOLEAN value_1;
LIST* value_2;
SYMBOL* value_3;
PROD* value_4;
int value_5;
pregex_ptn* value_6;
char* value_0;
BOOLEAN value_1;
LIST* value_2;
SYMBOL* value_3;
PROD* value_4;
int value_5;
pregex_ptn* value_6;
} _vtype;



/* Typedef for symbol information table */
typedef struct
{
char* name;
char* emit;
short type;
UNICC_BOOLEAN lexem;
UNICC_BOOLEAN whitespace;
UNICC_BOOLEAN greedy;
char* name;
char* emit;
short type;
UNICC_BOOLEAN lexem;
UNICC_BOOLEAN whitespace;
UNICC_BOOLEAN greedy;
} _syminfo;

/* Typedef for production information table */
typedef struct
{
char* definition;
char* emit;
int length;
int lhs;
char* definition;
char* emit;
int length;
int lhs;
} _prodinfo;


/* Abstract Syntax Tree */
typedef struct _AST _ast;

struct _AST
{
char* emit;
UNICC_SCHAR* token;
char* emit;
UNICC_SCHAR* token;

_ast* parent;
_ast* child;
_ast* prev;
_ast* next;
_ast* parent;
_ast* child;
_ast* prev;
_ast* next;
};

/* Stack Token */
typedef struct
{
_vtype value;
_ast* node;
_vtype value;
_ast* node;

_syminfo* symbol;
_syminfo* symbol;

int state;
unsigned int line;
unsigned int column;
int state;
unsigned int line;
unsigned int column;
} _tok;


/* Parser Control Block */
typedef struct
{
/* Is this PCB allocated by parser? */
char is_internal;

/* Stack */
_tok* stack;
_tok* tos;

/* Stack size */
unsigned int stacksize;

/* Values */
_vtype ret;
_vtype test;

/* State */
int act;
int idx;
int lhs;

/* Lookahead */
int sym;
int old_sym;
unsigned int len;

/* Input buffering */
UNICC_SCHAR* lexem;
UNICC_CHAR* buf;
UNICC_CHAR* bufend;
UNICC_CHAR* bufsize;

/* Lexical analysis */
UNICC_CHAR next;
UNICC_CHAR eof;
UNICC_BOOLEAN is_eof;

/* Error handling */
int error_delay;
int error_count;

unsigned int line;
unsigned int column;

/* Abstract Syntax Tree */
_ast* ast;

/* User-defined components */
pboolean main;
char* filename;
char* src;
/* Is this PCB allocated by parser? */
char is_internal;

/* Stack */
_tok* stack;
_tok* tos;

/* Stack size */
unsigned int stacksize;

/* Values */
_vtype ret;
_vtype test;

/* State */
int act;
int idx;
int lhs;

/* Lookahead */
int sym;
int old_sym;
unsigned int len;

/* Input buffering */
UNICC_SCHAR* lexem;
UNICC_CHAR* buf;
UNICC_CHAR* bufend;
UNICC_CHAR* bufsize;

/* Lexical analysis */
UNICC_CHAR next;
UNICC_CHAR eof;
UNICC_BOOLEAN is_eof;

/* Error handling */
int error_delay;
int error_count;

unsigned int line;
unsigned int column;

/* Abstract Syntax Tree */
_ast* ast;

/* User-defined components */
pboolean main;
char* filename;
char* src;


} _pcb;
Expand Down
Loading

0 comments on commit 0b1c021

Please sign in to comment.