Exemple #1
0
        private LetCommand parseLet()
        {
            if (CurrentToken != null && accept(_let))
            {
                LetCommand curRoot = new LetCommand(prevLine);

                if (root == null)
                {
                    root = curRoot;
                }


                while (CurrentToken.getType() != _in)
                {
                    // accept(_in);
                    curRoot.addDeclaration(parseDeclaration());
                }

                accept(_in);
                while (CurrentToken.getType() != _end)
                {
                    curRoot.addCommand(parseCommand());
                }

                accept(_end);
                return(curRoot);
            }
            logError(CurrentToken, "Syntax error: Let required.");
            return(null);
        }