public Expression ParseBase(List <object> tokens) { int index = 0; string startName = settings.getString("START"); PatternScope scope = new PatternScope(settings); Pattern rootPattern = scope.getPattern(startName); Expression result = rootPattern.Parse(tokens, ref index); if (index < tokens.Count) { return(null); } else { return(new Expression(new List <Expression>() { result })); } }
public Pattern_Operators(JSONArray template, PatternScope scope) { }
public Pattern_Bind(JSONArray template, PatternScope scope) { bindName = template.getString(1); body = scope.getPattern(template, 2); }
public Pattern_Optional(JSONArray template, PatternScope scope) { body = scope.getPattern(template, 1); }
public Pattern_Multi(JSONArray template, PatternScope scope) { body = scope.getPattern(template, 1); }
public Pattern_Identifier(JSONArray template, PatternScope scope) { }
public Pattern_Literal(JSONArray template, PatternScope scope) { literal = template.getString(1); }
public Pattern_Sequence(JSONArray template, PatternScope scope) { this.template = template; this.scope = scope; }