Permalink
Browse files

Testing semantic actions.

  • Loading branch information...
1 parent 5ff009f commit 4c62c335d108ca87d75368262132503ab47275df @hstefan hstefan committed Dec 7, 2011
Showing with 9 additions and 9 deletions.
  1. +3 −2 src/main.cpp
  2. +6 −7 src/parser.cpp
View
@@ -4,13 +4,14 @@
int main()
{
- StackFrame testedocaralho;
+ /*StackFrame testedocaralho;
testedocaralho.data.push_back(Entry(ENTRY_PARAMETER,1,"short Eita"));
testedocaralho.data.push_back(Entry(ENTRY_PARAMETER,1,"short Eita2"));
testedocaralho.data.push_back(Entry(ENTRY_VARIABLES,1,"short var1"));
testedocaralho.data.push_back(Entry(ENTRY_VARIABLES,4,"int var2"));
- printTable(testedocaralho);
+ printTable(testedocaralho);*/
+ parse::test_parse();
getchar();
return 0;
View
@@ -73,6 +73,10 @@ struct Grammar {
Grammar grammar;
+void testf() {
+ std::cout << "foo";
+}
+
void test_parse() {
std::string line;
std::getline(std::cin, line);
@@ -81,14 +85,9 @@ void test_parse() {
auto b = std::begin(line);
auto e = std::end(line);
-
- bool r = qi::phrase_parse(b, e, grammar.id, qi::space, val);
-
+
+ bool r = qi::phrase_parse(b, e, grammar.id[&testf], qi::space, val);
std::cout << val << std::endl;
}
-void parse(std::istream& in) {
-
-}
-
}

0 comments on commit 4c62c33

Please sign in to comment.