예제 #1
0
        // partie analyse syntaxique
        public static new Expression parse()
        {
            Expression resultat;

            resultat = new MotCle(jeton);
            prochainJeton();
            return(resultat);
        }
예제 #2
0
        public static Expression parse()
        {
            Expression resultat;

            if (jeton == "(")
            {
                prochainJeton();
                resultat = OperateurOu.parse();
                if (jeton == null)
                {
                    throw new Exception("Erreur de syntaxe");
                }
                if (jeton != ")")
                {
                    throw new Exception("Erreur de syntaxe");
                }
                prochainJeton();
            }
            else
            {
                resultat = MotCle.parse();
            }
            return(resultat);
        }