87 // |
87 // |
88 void Script::Parser::parse() |
88 void Script::Parser::parse() |
89 { |
89 { |
90 preprocess(); |
90 preprocess(); |
91 m_state.reset(); |
91 m_state.reset(); |
92 |
92 m_astRoot = Ast::spawnRoot(); |
93 while (next (TOK_Any)) |
93 |
94 { |
94 while (next()) |
95 print ("token: %1 (%2)\n", state().token.text, TokenNames[state().token.type]); |
95 { |
96 } |
96 if (m_state.token.type == TOK_Semicolon) |
|
97 continue; |
|
98 |
|
99 tokenMustBe (TOK_Macro); |
|
100 mustGetNext (TOK_Symbol); |
|
101 Ast::MacroPointer macroAst = Ast::spawn<Ast::MacroNode> (m_astRoot, state().token.text); |
|
102 mustGetNext (TOK_Semicolon); |
|
103 |
|
104 do |
|
105 { |
|
106 mustGetNext(); |
|
107 } while (m_state.token.type != TOK_EndMacro); |
|
108 } |
|
109 |
|
110 m_astRoot->dump(); |
97 } |
111 } |
98 |
112 |
99 // |
113 // |
100 // ------------------------------------------------------------------------------------------------- |
114 // ------------------------------------------------------------------------------------------------- |
101 // |
115 // |