Exemple #1
0
        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
                }));
            }
        }
Exemple #2
0
 public Pattern_Operators(JSONArray template, PatternScope scope)
 {
 }
Exemple #3
0
 public Pattern_Bind(JSONArray template, PatternScope scope)
 {
     bindName = template.getString(1);
     body     = scope.getPattern(template, 2);
 }
Exemple #4
0
 public Pattern_Optional(JSONArray template, PatternScope scope)
 {
     body = scope.getPattern(template, 1);
 }
Exemple #5
0
 public Pattern_Multi(JSONArray template, PatternScope scope)
 {
     body = scope.getPattern(template, 1);
 }
Exemple #6
0
 public Pattern_Identifier(JSONArray template, PatternScope scope)
 {
 }
Exemple #7
0
 public Pattern_Literal(JSONArray template, PatternScope scope)
 {
     literal = template.getString(1);
 }
Exemple #8
0
 public Pattern_Sequence(JSONArray template, PatternScope scope)
 {
     this.template = template;
     this.scope    = scope;
 }