static BuildRPNForAA() { RPNdictionary.Add(LFET.LexemBConstructor("id"), new Operator("idn")); RPNdictionary.Add(LFET.LexemBConstructor("const"), new Operator("const")); RPNdictionary.Add(LFET.LexemBConstructor("<term>", "*", "<multiple>"), new Operator("*")); RPNdictionary.Add(LFET.LexemBConstructor("<term>", "/", "<multiple>"), new Operator("/")); RPNdictionary.Add(LFET.LexemBConstructor("<expression>", "+", "<term1>"), new Operator("+")); RPNdictionary.Add(LFET.LexemBConstructor("<expression>", "-", "<term1>"), new Operator("-")); RPNdictionary.Add(LFET.LexemBConstructor("id", "=", "<expression1>"), new Operator(/*"end"*/ "assign")); RPNdictionary.Add(LFET.LexemBConstructor("<type>", "id", "=", "<expression1>"), new Operator(/*"end"*/ "declare")); }
public static LFET[] LexemBConstructor(params string[] lexemsText) { LFET[] mass = new LFET[lexemsText.Length]; for (int i = 0; i < lexemsText.Length; i++) { mass[i] = new LFET(lexemsText[i]); } return(mass); }