private void TransParams(ref TransCallPhrase aPhr) { if (lex.Type == LexemType.Operation && lex.Text == ",") { lex = lex.Next(); TransParam(ref aPhr); TransParams(ref aPhr); } }
private void TransParam(ref TransCallPhrase aPhr) { aPhr.AddParametr(Expr()); /* * //determine param type * if (lex.Type == LexemType.Terminal) * {//string * aPhr.AddParametr(new TextDerivation(lex.Text)); * lex = lex.Next(); * } * else * {//int * aPhr.AddParametr(ParseIntValue()); * } */ }
//lex: Rnd( ^ [param]) private PhraseBase TransCall1(Access aBaseAcc, string aTransName) { TransCallPhrase lPhr = new TransCallPhrase(mGrammar, aTransName, aBaseAcc); if (lex.Text != ")") { //here is at least 1 param - parse it TransParam(ref lPhr); TransParams(ref lPhr); } Expect(LexemType.RightBr, ")"); lPhr.DoBinding(); IExpr lExpr = lPhr; if (Acc(ref lExpr)) { return((PhraseBase)lExpr); } return(lPhr); }