private void PopulateSequence() { if (this.sequence != null) { return; } this.sequence = new List <Pattern>(); for (int Idx = 1; Idx < template.Length; ++Idx) { sequence.Add(scope.getPattern(template, Idx)); } }
private void PopulateOptions() { if (this.options != null) { return; } this.options = new List <Pattern>(); for (int Idx = 1; Idx < template.Length; ++Idx) { options.Add(scope.getPattern(template, Idx)); } }
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_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); }