2005-01-19 Andrew Cagney <cagney@gnu.org>
[deliverable/binutils-gdb.git] / gdb / jv-exp.y
index d47a65b6cc568d57e5a98c1db4d345e9fbeca0a0..a3d1210445465bcbf7411dd0690ab06c7a62a573 100644 (file)
@@ -446,13 +446,22 @@ FieldAccess:
 /*|    SUPER '.' SimpleName { FIXME } */
 ;
 
+FuncStart:
+       Name '('
+                { push_expression_name ($1); }
+;
+
 MethodInvocation:
-       Name '(' ArgumentList_opt ')'
-               { error (_("Method invocation not implemented")); }
+       FuncStart
+                { start_arglist(); }
+       ArgumentList_opt ')'
+                { write_exp_elt_opcode (OP_FUNCALL);
+                 write_exp_elt_longcst ((LONGEST) end_arglist ());
+                 write_exp_elt_opcode (OP_FUNCALL); }
 |      Primary '.' SimpleName '(' ArgumentList_opt ')'
-               { error (_("Method invocation not implemented")); }
+               { error (_("Form of method invocation not implemented")); }
 |      SUPER '.' SimpleName '(' ArgumentList_opt ')'
-               { error (_("Method invocation not implemented")); }
+               { error (_("Form of method invocation not implemented")); }
 ;
 
 ArrayAccess:
@@ -872,7 +881,7 @@ yylex ()
   tokstart = lexptr;
   /* See if it is a special token of length 3.  */
   for (i = 0; i < sizeof tokentab3 / sizeof tokentab3[0]; i++)
-    if (STREQN (tokstart, tokentab3[i].operator, 3))
+    if (strncmp (tokstart, tokentab3[i].operator, 3) == 0)
       {
        lexptr += 3;
        yylval.opcode = tokentab3[i].opcode;
@@ -881,7 +890,7 @@ yylex ()
 
   /* See if it is a special token of length 2.  */
   for (i = 0; i < sizeof tokentab2 / sizeof tokentab2[0]; i++)
-    if (STREQN (tokstart, tokentab2[i].operator, 2))
+    if (strncmp (tokstart, tokentab2[i].operator, 2) == 0)
       {
        lexptr += 2;
        yylval.opcode = tokentab2[i].opcode;
@@ -1133,43 +1142,43 @@ yylex ()
   switch (namelen)
     {
     case 7:
-      if (STREQN (tokstart, "boolean", 7))
+      if (DEPRECATED_STREQN (tokstart, "boolean", 7))
        return BOOLEAN;
       break;
     case 6:
-      if (STREQN (tokstart, "double", 6))      
+      if (DEPRECATED_STREQN (tokstart, "double", 6))      
        return DOUBLE;
       break;
     case 5:
-      if (STREQN (tokstart, "short", 5))
+      if (DEPRECATED_STREQN (tokstart, "short", 5))
        return SHORT;
-      if (STREQN (tokstart, "false", 5))
+      if (DEPRECATED_STREQN (tokstart, "false", 5))
        {
          yylval.lval = 0;
          return BOOLEAN_LITERAL;
        }
-      if (STREQN (tokstart, "super", 5))
+      if (DEPRECATED_STREQN (tokstart, "super", 5))
        return SUPER;
-      if (STREQN (tokstart, "float", 5))
+      if (DEPRECATED_STREQN (tokstart, "float", 5))
        return FLOAT;
       break;
     case 4:
-      if (STREQN (tokstart, "long", 4))
+      if (DEPRECATED_STREQN (tokstart, "long", 4))
        return LONG;
-      if (STREQN (tokstart, "byte", 4))
+      if (DEPRECATED_STREQN (tokstart, "byte", 4))
        return BYTE;
-      if (STREQN (tokstart, "char", 4))
+      if (DEPRECATED_STREQN (tokstart, "char", 4))
        return CHAR;
-      if (STREQN (tokstart, "true", 4))
+      if (DEPRECATED_STREQN (tokstart, "true", 4))
        {
          yylval.lval = 1;
          return BOOLEAN_LITERAL;
        }
       break;
     case 3:
-      if (STREQN (tokstart, "int", 3))
+      if (strncmp (tokstart, "int", 3) == 0)
        return INT;
-      if (STREQN (tokstart, "new", 3))
+      if (strncmp (tokstart, "new", 3) == 0)
        return NEW;
       break;
     default:
This page took 0.028958 seconds and 4 git commands to generate.