Esempio n. 1
0
        public override ParseTree Parse(Lexer lexer, ParserState state)
        {
            if (!simple && (state.LeftHandSide != null))
            {
                Type leftType    = state.LeftHandSide.Value.GetType();
                Type patternType = pattern.Type;

                if ((leftType == patternType) || leftType.IsSubclassOf(patternType))
                {
                    state.RuntimeState.Runtime.ParseTrace.Single("left hand side from recursion");

                    lexer.Position = state.LeftHandSideEndPos;
                    return(state.LeftHandSide);
                }
            }

            return(pattern.Parse(lexer, state));
        }