added class node to parser to store parsed node types (YYSTYPE is now Node)
git-svn-id: svn://anubis/fart/trunk@88 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
parent
3da5e6d569
commit
70eeff90fb
@ -20,7 +20,16 @@ int yywrap()
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define YYSTYPE void *
|
class Node
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Node();
|
||||||
|
Node(int type, void * ptr);
|
||||||
|
int type;
|
||||||
|
void * ptr;
|
||||||
|
};
|
||||||
|
|
||||||
|
#define YYSTYPE Node
|
||||||
|
|
||||||
%}
|
%}
|
||||||
|
|
||||||
@ -185,3 +194,14 @@ int parse(const char * fileName)
|
|||||||
yyparse();
|
yyparse();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Node::Node()
|
||||||
|
{
|
||||||
|
type = -1;
|
||||||
|
ptr = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
Node::Node(int type, void * ptr)
|
||||||
|
{
|
||||||
|
this->type = type;
|
||||||
|
this->ptr = ptr;
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user