if (parentStream instanceof SIRPipeline) { if (args.length > 1) at.dms.util.Utils.fail("Exactly one arg to add() allowed");  JExpression SIROp = (JExpression) args[0].accept(this);    if (SIROp instanceof JUnqualifiedInstanceCreation) { SIRStream st = (SIRStream)getVisitedOp(((JUnqualifiedInstanceCreation)SIROp). getType().getCClass().getIdent()); ((SIRPipeline)parentStream).add(st); }
if (!(parentStream instanceof SIRPipeline)) at.dms.util.Utils.fail("Add method called on Non-Pipeline"); if (args.length > 1) at.dms.util.Utils.fail("Exactly one arg to add() allowed");  JExpression SIROp = (JExpression) args[0].accept(this);    if (SIROp instanceof JUnqualifiedInstanceCreation) { SIRStream st = (SIRStream)getVisitedOp(((JUnqualifiedInstanceCreation)SIROp). getType().getCClass().getIdent()); ((SIRPipeline)parentStream).add(st);
    public Object visitMethodCallExpression(JMethodCallExpression self,                                          JExpression prefix,                                          String ident,                                          JExpression[] args)    {	blockStart("MethodCallExpression: " + self.getIdent());        	if (isSIRExp(self)) {	    printMe("SIR Expression " + ident);	    return newSIRExp(self, args);	}	else if (ident.equals("add")) {            //Handle an add call in a pipeline	    //Parent must be a pipeline	    if (parentStream instanceof SIRPipeline) {		if (args.length > 1)		    at.dms.util.Utils.fail("Exactly one arg to add() allowed");		//Visit the argument (Exactly one)		JExpression SIROp = (JExpression) args[0].accept(this);		//if it is a anonymous creation do nothing, it will be added elsewhere		//if it is a named creation, lookup in the symbol table for the visited		//node and add it to the pipeline		if (SIROp instanceof JUnqualifiedInstanceCreation) {		    SIRStream st = (SIRStream)getVisitedOp(((JUnqualifiedInstanceCreation)SIROp).						getType().getCClass().getIdent());		    ((SIRPipeline)parentStream).add(st);		}	    }	}	else {             //Not an SIR call	    for (int i = 0; i < args.length; i++)		args[i] = (JExpression) args[i].accept(this);	}	return self;    }