Skip to content

Commit

Permalink
Wrote some PS Grammar.
Browse files Browse the repository at this point in the history
  • Loading branch information
brennana committed Oct 2, 2012
1 parent a2c389f commit b131c67
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion PorkParser/PorkParser.cpp
Expand Up @@ -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 >>
Expand Down
29 changes: 28 additions & 1 deletion PorkParser/PorkParser.h
Expand Up @@ -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
{

Expand All @@ -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
Expand Down

0 comments on commit b131c67

Please sign in to comment.