Permalink
Browse files

Wrote some PS Grammar.

  • Loading branch information...
1 parent a2c389f commit b131c67f688f572173840bfbf58d06b5e6d2a0c5 @brennana brennana committed Oct 2, 2012
Showing with 29 additions and 2 deletions.
  1. +1 −1 PorkParser/PorkParser.cpp
  2. +28 −1 PorkParser/PorkParser.h
@@ -172,7 +172,7 @@ pork_grammar::pork_grammar():
identifier %= +char_("0-9a-zA-Z");
value %= quoted_string | long_ | bool_ | identifier;
-
+
qualifier %= identifier > lit(".") > identifier;
list_element %= value >>
View
@@ -124,6 +124,33 @@ namespace PorkParserSpace
}
};
+ typedef variant<std::pair<string, string>, string> set_ident;
+ typedef variant<string, long, bool> set_value;
+
+ struct set_list_element
+ {
+
+ };
+
+ struct set_property_dynamic_struct
+ {
+
+ };
+
+ struct set_property_ex_struct
+ {
+ set_ident identifier;
+
+ };
+
+ struct set_property_struct
+ {
+ set_ident identifier;
+ set_value value;
+ };
+
+ typedef variant<set_property_struct, set_property_ex_struct, set_property_dynamic_struct> set_property;
+
struct set_state_struct
{
@@ -132,7 +159,7 @@ namespace PorkParserSpace
struct def_struct
{
string type;
- variant<vector<set_state_struct>,vector<variant<set_property_struct, set_property_ex_struct, set_property_dynamic_struct>>> statements;
+ variant<vector<set_state_struct>,vector<set_property>> statements;
};
// struct to hold all parsed maps/items for insertion into GC

0 comments on commit b131c67

Please sign in to comment.