Added a couple notes to the larger sample

This commit is contained in:
Jonathan Turner 2009-05-27 21:42:34 +00:00
parent 891650b97d
commit ab3b9e2fe7

View File

@ -56,13 +56,16 @@ void parse(std::vector<TokenPtr> &tokens) {
Rule rule = lhs << rhs;
lhs = Str("def", true);
rhs = Id(TokenType::Identifier, true);
*/
//Rule rule(TokenType::Function_Def);
//rule = Str("def") | Str("int");
//Rule rule = Str("def", false) << Id(TokenType::Identifier);
*/
//Example: "def add(x,y)"
//To do the params for real we need kleene star and other looping parsers
Rule params;
Rule rule(TokenType::Function_Def);
rule = Ign(Str("def")) << Id(TokenType::Identifier) << Ign(Str("(")) << params << Ign(Str(")"));