Beispiel #1
0
        private static List <int> ParseMFInt32(Tokenizer t)
        {
            List <int> result = new List <int>();

            Tokenizer.Token token = t.NextToken();
            if (token.IsBracketOpen)
            {
                token = t.NextToken();
                while (!token.IsBracketClose)
                {
                    result.Add(token.ToInt32());
                    token = t.NextToken();
                }
            }
            else
            {
                result.Add(token.ToInt32());
            }

            return(result);
        }
Beispiel #2
0
        private static List <string> ParseMFString(Tokenizer t)
        {
            List <string> result = new List <string>();

            Tokenizer.Token token = t.NextToken();
            if (token.IsBracketOpen)
            {
                token = t.NextToken();
                while (!token.IsBracketClose)
                {
                    result.Add(token.GetCheckedUnquotedString());
                    token = t.NextToken();
                }
            }
            else
            {
                result.Add(token.GetCheckedUnquotedString());
            }

            return(result);
        }
Beispiel #3
0
        private static void ExpectBraceClose(Tokenizer t)
        {
            Tokenizer.Token token = t.NextToken();
            if (token.IsBraceClose)
            {
                return;
            }

            throw new ParseException(
                      "Token '}' expected. Found " + token.ToString() + " instead!"
                      );
        }
Beispiel #4
0
        private static SymMapBase ParseROUTE(Tokenizer t)
        {
            SymMapBase result = new SymMapBase();

            // nodeNameId.eventOutId
            result["out"] = t.NextNameToken().ToString();
            // "TO"
            t.NextToken();
            // nodeNameId.eventInId
            result["in"] = t.NextNameToken().ToString();

            return(result);
        }
Beispiel #5
0
        private static List <SymMapBase> ParseMFNode(Tokenizer t)
        {
            List <SymMapBase> result = new List <SymMapBase>();

            Tokenizer.Token token = t.NextToken();
            if (token.IsBracketOpen)
            {
                token = t.NextToken();
                while (!token.IsBracketClose)
                {
                    t.PushBack(token);
                    result.Add(ParseNode(t));
                    token = t.NextToken();
                }
            }
            else
            {
                t.PushBack(token);
                result.Add(ParseNode(t));
            }

            return(result);
        }
Beispiel #6
0
 private static string ParseSFString(Tokenizer t)
 {
     Tokenizer.Token token = t.NextToken();
     return(token.GetCheckedUnquotedString());
 }
Beispiel #7
0
 private static object ParseSFInt32(Tokenizer t)
 {
     Tokenizer.Token token = t.NextToken();
     return(token.ToInt32());
 }
Beispiel #8
0
 private static object ParseSFFloat(Tokenizer t)
 {
     Tokenizer.Token token = t.NextToken();
     return(token.ToFloat());
 }
Beispiel #9
0
 private static object ParseSFBool(Tokenizer t)
 {
     Tokenizer.Token token = t.NextToken();
     return(token.ToBool());
 }