public override void Accept (TupleExpression tuple) { tuple.VisitChildren (this); methodBuilder.EmitInstruction (tuple.Location, Opcode.BuildTuple, tuple.Children.Count); }
private static AstNode ParseTuple(AstNode firstVal, TokenStream stream) { TupleExpression tuple = new TupleExpression (stream.Location); tuple.Add (firstVal); while (!stream.Match (TokenClass.CloseParan)) { tuple.Add (ParseExpression (stream)); if (!stream.Accept (TokenClass.Comma)) { break; } } stream.Expect (TokenClass.CloseParan); return tuple; }
public void Accept(TupleExpression tuple) { visitSubnodes (tuple); methodBuilder.EmitInstruction (tuple.Location, Opcode.BuildTuple, tuple.Children.Count); }
public void Accept(TupleExpression tuple) { tuple.Visit (functionCompiler); }
public override void Accept (TupleExpression tuple) { tuple.VisitChildren (this); }
public override void Accept (TupleExpression tuple) { IodineLabel startLabel = methodBuilder.CreateLabel (); IodineLabel endLabel = methodBuilder.CreateLabel (); int item = methodBuilder.CreateTemporary (); PatternCompiler compiler = new PatternCompiler (symbolTable, methodBuilder, item, parentVisitor); for (int i = 0; i < tuple.Children.Count; i++) { if (tuple.Children [i] is NameExpression && ((NameExpression)tuple.Children [i]).Value == "_") continue; methodBuilder.EmitInstruction (tuple.Location, Opcode.LoadLocal, temporary); methodBuilder.EmitInstruction (tuple.Location, Opcode.LoadConst, methodBuilder.Module.DefineConstant (new IodineInteger (i))); methodBuilder.EmitInstruction (tuple.Location, Opcode.LoadIndex); methodBuilder.EmitInstruction (tuple.Location, Opcode.StoreLocal, item); tuple.Children [i].Visit (compiler); methodBuilder.EmitInstruction (tuple.Location, Opcode.JumpIfFalse, endLabel); } methodBuilder.EmitInstruction (tuple.Location, Opcode.LoadTrue); methodBuilder.EmitInstruction (tuple.Location, Opcode.Jump, startLabel); methodBuilder.MarkLabelPosition (endLabel); methodBuilder.EmitInstruction (tuple.Location, Opcode.LoadFalse); methodBuilder.MarkLabelPosition (startLabel); }
public virtual void Accept(TupleExpression tuple) { }