From ab3b9e2fe730b54a65bd6bf94b1014dd620e1616 Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Wed, 27 May 2009 21:42:34 +0000 Subject: [PATCH] Added a couple notes to the larger sample --- langkit/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/langkit/main.cpp b/langkit/main.cpp index fd8bf517..0b07eab2 100644 --- a/langkit/main.cpp +++ b/langkit/main.cpp @@ -56,13 +56,16 @@ void parse(std::vector &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(")"));