Ejemplo n.º 1
0
        public static Token Create(ContinueQueue parsingObject)
        {
            Label label = Label.Create(parsingObject);
            Token token = null;

            string content = parsingObject.Dequeue();

            if (!char.IsLetterOrDigit(content[0]))
            {
                char character = content[0];
                switch (character)
                {
                case '(':
                    break;

                case '{':
                    break;

                case '\"':
                    token = FormatString.Create(parsingObject);
                    break;

                //  # Pre-interpretation option. eg. #include <stdlib>
                case '#':
                    token = PreInterpretationStatement.Create(parsingObject);
                    break;

                // // Comment. eg. // Comment
                case '/':
                    if (parsingObject.Peek()[0] == '/')
                    {
                        parsingObject.Dequeue();
                        token = Comment.Create(parsingObject);
                    }
                    break;

                default:
                    break;
                }
            }
            else
            {
                switch (content)
                {
                case "if":
                    token = If_Procedure.Create(parsingObject);
                    break;

                default:
                    break;
                }
            }

            token.Label = label;
            return(token);
        }
Ejemplo n.º 2
0
        public new static PreInterpretationStatement Create(ContinueQueue parsingObject)
        {
            PreInterpretationStatement prefab = new PreInterpretationStatement();

            string next = parsingObject.Dequeue();

            switch (next)
            {
            case "include":
                prefab.CreateInclude(parsingObject);
                break;

            case "readonly":
                File.prefab.IsReadOnly = true;
                break;

            default:
                break;
            }

            return(prefab);
        }