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