Exemple #1
0
		public virtual void VisitBlockExpression(BlockExpression expression)
		{
			VisitNodes(expression.Parameters);
			VisitNodes(expression.Statements);
			VisitCommonExpNodes(expression);
		}
Exemple #2
0
		public LambdaExpression(BlockExpression inner)
		{
		}
Exemple #3
0
	public void blockargs(
		BlockExpression bexp
	) //throws RecognitionException, TokenStreamException
{
		
		ParameterVarIdentifier ident = null;
		
		match(BOR);
		ident=methodParam();
		if (0==inputState.guessing)
		{
			bexp.AddBlockFormalParameter(ident);
		}
		{    // ( ... )*
			for (;;)
			{
				if ((LA(1)==COMMA))
				{
					match(COMMA);
					ident=methodParam();
					if (0==inputState.guessing)
					{
						bexp.AddBlockFormalParameter(ident);
					}
				}
				else
				{
					goto _loop97_breakloop;
				}
				
			}
_loop97_breakloop:			;
		}    // ( ... )*
		match(BOR);
	}
Exemple #4
0
	public BlockExpression  block() //throws RecognitionException, TokenStreamException
{
		BlockExpression bexp;
		
		bexp = new BlockExpression();
		
		if (0==inputState.guessing)
		{
			PushScope(bexp, ScopeType.Block);
		}
		{
			switch ( LA(1) )
			{
			case DO:
			{
				{
					match(DO);
					nothing();
					{
						switch ( LA(1) )
						{
						case BOR:
						{
							blockargs(bexp);
							break;
						}
						case EOF:
						case CLASS:
						case DO:
						case END:
						case DEF:
						case BEGIN:
						case NUM_INT:
						case NUM_FLOAT:
						case NUM_LONG:
						case STATEMENT_END:
						case IDENT:
						case STATICIDENT:
						case INSTIDENT:
						case SEMI:
						case LITERAL_self:
						case LPAREN:
						case LITERAL_require:
						case LITERAL_redo:
						case LITERAL_break:
						case LITERAL_next:
						case LITERAL_retry:
						case LITERAL_lambda:
						case LCURLY:
						case LITERAL_raise:
						case LITERAL_yield:
						case LITERAL_not:
						case LNOT:
						case PLUS:
						case MINUS:
						case BNOT:
						case LBRACK:
						case LITERAL_base:
						case STRING_LITERAL:
						case CHAR_LITERAL:
						{
							break;
						}
						default:
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						 }
					}
					{
						switch ( LA(1) )
						{
						case EOF:
						case STATEMENT_END:
						case SEMI:
						{
							statement_term();
							break;
						}
						case CLASS:
						case DO:
						case END:
						case DEF:
						case BEGIN:
						case NUM_INT:
						case NUM_FLOAT:
						case NUM_LONG:
						case IDENT:
						case STATICIDENT:
						case INSTIDENT:
						case LITERAL_self:
						case LPAREN:
						case LITERAL_require:
						case LITERAL_redo:
						case LITERAL_break:
						case LITERAL_next:
						case LITERAL_retry:
						case LITERAL_lambda:
						case LCURLY:
						case LITERAL_raise:
						case LITERAL_yield:
						case LITERAL_not:
						case LNOT:
						case PLUS:
						case MINUS:
						case BNOT:
						case LBRACK:
						case LITERAL_base:
						case STRING_LITERAL:
						case CHAR_LITERAL:
						{
							break;
						}
						default:
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						 }
					}
					suite(bexp.Statements);
					match(END);
				}
				break;
			}
			case LCURLY:
			{
				{
					match(LCURLY);
					nothing();
					{
						switch ( LA(1) )
						{
						case BOR:
						{
							blockargs(bexp);
							break;
						}
						case EOF:
						case CLASS:
						case DO:
						case DEF:
						case BEGIN:
						case NUM_INT:
						case NUM_FLOAT:
						case NUM_LONG:
						case STATEMENT_END:
						case IDENT:
						case STATICIDENT:
						case INSTIDENT:
						case SEMI:
						case LITERAL_self:
						case LPAREN:
						case LITERAL_require:
						case LITERAL_redo:
						case LITERAL_break:
						case LITERAL_next:
						case LITERAL_retry:
						case LITERAL_lambda:
						case LCURLY:
						case RCURLY:
						case LITERAL_raise:
						case LITERAL_yield:
						case LITERAL_not:
						case LNOT:
						case PLUS:
						case MINUS:
						case BNOT:
						case LBRACK:
						case LITERAL_base:
						case STRING_LITERAL:
						case CHAR_LITERAL:
						{
							break;
						}
						default:
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						 }
					}
					{
						switch ( LA(1) )
						{
						case EOF:
						case STATEMENT_END:
						case SEMI:
						{
							statement_term();
							break;
						}
						case CLASS:
						case DO:
						case DEF:
						case BEGIN:
						case NUM_INT:
						case NUM_FLOAT:
						case NUM_LONG:
						case IDENT:
						case STATICIDENT:
						case INSTIDENT:
						case LITERAL_self:
						case LPAREN:
						case LITERAL_require:
						case LITERAL_redo:
						case LITERAL_break:
						case LITERAL_next:
						case LITERAL_retry:
						case LITERAL_lambda:
						case LCURLY:
						case RCURLY:
						case LITERAL_raise:
						case LITERAL_yield:
						case LITERAL_not:
						case LNOT:
						case PLUS:
						case MINUS:
						case BNOT:
						case LBRACK:
						case LITERAL_base:
						case STRING_LITERAL:
						case CHAR_LITERAL:
						{
							break;
						}
						default:
						{
							throw new NoViableAltException(LT(1), getFilename());
						}
						 }
					}
					suite(bexp.Statements);
					match(RCURLY);
				}
				break;
			}
			default:
			{
				throw new NoViableAltException(LT(1), getFilename());
			}
			 }
		}
		if (0==inputState.guessing)
		{
			PopScope();
		}
		return bexp;
	}
Exemple #5
0
		public override void VisitBlockExpression(BlockExpression expression)
		{
			nodeStack.Push( CurrentNode.Nodes.Add("BlockExpression [" + expression.Parameters.Count + " params ] " ));
			CurrentNode.Tag = expression;

			base.VisitBlockExpression(expression);

			nodeStack.Pop();
		}
 public LambdaExpression(BlockExpression block)
 {
     this.block = block;
 }