Skip to content

Commit

Permalink
2. lépés
Browse files Browse the repository at this point in the history
  • Loading branch information
gabboraron authored Nov 25, 2019
1 parent c006a03 commit c5f8c30
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions assign1/Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ class Parser: public ParserBase
void nextToken();
void print__();
void exceptionHandler__(std::exception const &exc);
std::map<std::string,var_data> szimbolumtabla;
};


Expand Down
2 changes: 1 addition & 1 deletion assign1/assign.y
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%baseclass-preinclude <iostream>
%baseclass-preinclude "semantics.h"
%lsp-needed

%token NATURAL;
Expand Down
18 changes: 18 additions & 0 deletions assign1/semantics.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#include <iostream>
#include <string>
#include <map>

enum type {natural, boolean};


struct var_data
{
int decl_row;
type var_type;
var_data(int id,type tp){
decl_row = id;
var_type = tp;
};
var_data(){};
};

0 comments on commit c5f8c30

Please sign in to comment.