summaryrefslogtreecommitdiff
path: root/miniany/cc.c
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2021-08-15 16:05:11 +0000
committerAndreas Baumann <mail@andreasbaumann.cc>2021-08-15 16:05:11 +0000
commit5dc6889265cb5f0c385778f075279ed8012023a0 (patch)
tree946aba2be38bc73ee3f0fa3750ee8dc2815a4d74 /miniany/cc.c
parent9ba1bb3d2007b37e3392208ef027f88d78e51c3e (diff)
downloadcompilertests-5dc6889265cb5f0c385778f075279ed8012023a0.tar.gz
compilertests-5dc6889265cb5f0c385778f075279ed8012023a0.tar.bz2
added NULL and EOF (-1 as emum initialized in c4)
Diffstat (limited to 'miniany/cc.c')
-rw-r--r--miniany/cc.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/miniany/cc.c b/miniany/cc.c
index ebdebdb..e5b30c7 100644
--- a/miniany/cc.c
+++ b/miniany/cc.c
@@ -8,8 +8,7 @@ int token;
int DEBUG_SCANNER;
enum {
- MAX_IDENT_LEN = 20,
- TEST = -1
+ MAX_IDENT_LEN = 20
};
void pushBack( int c )
@@ -254,11 +253,23 @@ void parseExpression( )
}
}
+//~ struct Symbol {
+ //~ char *name;
+//~ };
+
+//~ struct Symbol *symbol;
+
+void newSymbol( char *s )
+{
+
+}
+
void parseDeclaration( )
{
expect( S_INT, "int" );
expect( S_IDENT, "identifier" );
putstring( "Adding glob: " ); putstring( ident ); putnl( );
+ newSymbol( ident );
expect( S_SEMICOLON, ";" );
}
@@ -287,6 +298,7 @@ int main( int argc, char **argv )
row = 1;
pushback = 0;
DEBUG_SCANNER = 1;
+ //~ symbol = NULL;
ident = "12345678901234567890";
token = getToken( );