Making GLSL AST nodes while preserving lineno info

Eventually we will need some way to locate an identifier's
definition, so add "lineno" to each AST node.  May want to
change this to "position" later.  The makeAstNode<T>() function
takes care of automatically decorating nodes with line numbers.
This commit is contained in:
Rhys Weatherley
2010-11-12 09:53:08 +10:00
parent 73d570c83a
commit 73f77a0b8e
4 changed files with 417 additions and 332 deletions

View File

@@ -70,10 +70,10 @@ class GLSL_EXPORT List: public Managed
{
public:
List(const T &value)
: value(value), next(this) {}
: value(value), next(this), lineno(0) {}
List(List *previous, const T &value)
: value(value)
: value(value), lineno(0)
{
next = previous->next;
previous->next = this;
@@ -88,6 +88,7 @@ public:
T value;
List *next;
int lineno;
};
// Append two lists, which are assumed to still be circular, pre-finish.