Esempio n. 1
0
 public string Visit(Exclamation_ node, int modo)
 {
     //var compareWith = "\t\tldc.i8 0 \n" +"\t\tceq\n" + "\t\tconv.i8\n";
     //return compareWith;
     return(null);
 }
Esempio n. 2
0
        public Node expr_primary()
        {
            //Console.WriteLine("expr_primary");
            if (CurrentToken == TokenCategory.IDENTIFIER)
            {
                //Console.WriteLine("expr_primary1");
                var id = new Id_();
                var r  = Expect(TokenCategory.IDENTIFIER);
                id.AnchorToken = r;
                if (CurrentToken == TokenCategory.OPENP)
                {
                    //Console.WriteLine("expr_primary2");
                    Expect(TokenCategory.OPENP);
                    if (CurrentToken != TokenCategory.CLOSEP) /////////////////////////////MODIFICADO///////////////////////////
                    {
                        id.Add(expr_list());
                    }
                    Expect(TokenCategory.CLOSEP);
                    //Console.WriteLine("semi9");
                    //Expect(TokenCategory.SEMICOLON);
                }
                return(id);
            }
            else if (CurrentToken == TokenCategory.FALSE)
            {
                //Console.WriteLine("expr_primary3");
                var False = new False_();
                var r     = Expect(TokenCategory.FALSE);
                False.AnchorToken = r;
                return(False);
            }
            else if (CurrentToken == TokenCategory.TRUE)
            {
                //Console.WriteLine("expr_primary4");
                var False = new True_();
                var r     = Expect(TokenCategory.TRUE);
                False.AnchorToken = r;
                return(False);
            }
            else if (CurrentToken == TokenCategory.CHARACTER)
            {
                //Console.WriteLine("expr_primary5");
                var False = new Character_();
                var r     = Expect(TokenCategory.CHARACTER);
                False.AnchorToken = r;
                return(False);
            }
            else if (CurrentToken == TokenCategory.INTEGER)
            {
                //Console.WriteLine("expr_primary6");
                var False = new Integer_();
                var r     = Expect(TokenCategory.INTEGER);
                False.AnchorToken = r;
                return(False);
            }
            else if (CurrentToken == TokenCategory.BINARYINT)
            {
                //Console.WriteLine("expr_primary7");
                var False = new Integer_();
                var r     = Expect(TokenCategory.BINARYINT);
                False.AnchorToken = r;
                return(False);
            }
            else if (CurrentToken == TokenCategory.OCTALINT)
            {
                //Console.WriteLine("expr_primary8");
                var False = new Integer_();
                var r     = Expect(TokenCategory.OCTALINT);
                False.AnchorToken = r;
                return(False);
            }
            else if (CurrentToken == TokenCategory.HEXAINT)
            {
                //Console.WriteLine("expr_primary9");
                var False = new Integer_();
                var r     = Expect(TokenCategory.HEXAINT);
                False.AnchorToken = r;
                return(False);
            }
            else if (CurrentToken == TokenCategory.STRING)
            {
                //Console.WriteLine("expr_primary10");
                var False = new String_();
                var r     = Expect(TokenCategory.STRING);
                False.AnchorToken = r;
                return(False);
            }
            else if (CurrentToken == TokenCategory.OPENP)
            {
                //Console.WriteLine("expr_primary11");
                var openp = new Openp_();
                var r     = Expect(TokenCategory.OPENP);
                openp.AnchorToken = r;
                //Console.WriteLine("CURRRRRRRREEEEENT" + CurrentToken);
                if (CurrentToken != TokenCategory.CLOSEP)
                {
                    openp.Add(expr());
                }

                Expect(TokenCategory.CLOSEP);
                return(openp);
            }
            else if (CurrentToken == TokenCategory.OPENB)
            {
                //Console.WriteLine("expr_primary12");
                var r = array_list();
                return(r);
            }
            else if (CurrentToken == TokenCategory.EXCLAMATION)
            {
                //Console.WriteLine("expr_primary13");
                var exclamation = new Exclamation_();
                var r           = Expect(TokenCategory.EXCLAMATION);
                exclamation.AnchorToken = r;
                if (CurrentToken == TokenCategory.IDENTIFIER)
                {
                    var id = new Id_();
                    var m  = Expect(TokenCategory.IDENTIFIER);
                    id.AnchorToken = m;
                    exclamation.Add(id);
                }
                return(exclamation);
            }
            else
            {
                throw new SyntaxError(firstOfSimpleExpression, tokenStream.Current);
            }
        }
Esempio n. 3
0
 public void Visit(Exclamation_ node, int modo)
 {
     VisitChildren(node, modo);
 }