]> git.tdb.fi Git - libs/gl.git/blobdiff - source/programparser.cpp
Add an intermediate node type for statements
[libs/gl.git] / source / programparser.cpp
index c02adb325c25eaba6d4df7f31d9b8963506a5cd4..07fa19de655e774aa0765e5bd20f3c0d14f58d48 100644 (file)
@@ -3,6 +3,8 @@
 #include <msp/strings/regex.h>
 #include "programparser.h"
 
+#undef interface
+
 using namespace std;
 
 namespace Msp {
@@ -110,7 +112,7 @@ void ProgramParser::parse_source()
        source_end = source.end();
        current_line = 1;
        allow_preprocess = true;
-       while(RefPtr<Node> statement = parse_global_declaration())
+       while(RefPtr<Statement> statement = parse_global_declaration())
                cur_stage->content.body.push_back(statement);
 }
 
@@ -424,7 +426,7 @@ void ProgramParser::preprocess_stage()
        cur_stage = &module->stages.back();
 }
 
-RefPtr<Node> ProgramParser::parse_global_declaration()
+RefPtr<Statement> ProgramParser::parse_global_declaration()
 {
        allow_stage_change = true;
        string token = peek_token();
@@ -478,7 +480,7 @@ RefPtr<Node> ProgramParser::parse_global_declaration()
                throw runtime_error(format_syntax_error("a global declaration"));
 }
 
-RefPtr<Node> ProgramParser::parse_statement()
+RefPtr<Statement> ProgramParser::parse_statement()
 {
        string token = peek_token();
        if(token=="if")