import gdb-2000-02-02 snapshot
[external/binutils.git] / binutils / sysinfo.y
index d5f9c64..0aa8737 100644 (file)
@@ -1,4 +1,7 @@
 %{
+#include <stdio.h>
+#include <stdlib.h>
+
 extern char *word;
 extern char writecode;
 extern int number;
@@ -24,7 +27,7 @@ char *pnames[]= {"","*","**"};
 } 
 %token COND
 %token REPEAT
-%token '(' ')' '[' ']'
+%token '(' ')'
 %token <s> TYPE
 %token <s> NAME
 %token <i> NUMBER UNIT
@@ -95,10 +98,9 @@ it:
            printf("size = fillup(raw);\n");
            break;
          case 'g':
-           printf("void sysroff_swap_%s_out(file,ptr,last)\n",$2);
+           printf("void sysroff_swap_%s_out(file,ptr)\n",$2);
            printf("FILE * file;\n");
            printf("struct IT_%s *ptr;\n", it);
-           printf("int last;\n");
            printf("{\n");
            printf("\tchar raw[255];\n");
            printf("\tint idx = 16 ;\n");
@@ -132,7 +134,7 @@ it:
     printf("};\n");
     break;
   case 'g':
-    printf("\tchecksum(file,raw, idx, IT_%s_CODE, last);\n", it);
+    printf("\tchecksum(file,raw, idx, IT_%s_CODE);\n", it);
     
   case 'i':
 
@@ -270,7 +272,7 @@ char *ptr = pnames[rdepth];
 
                if (rdepth == 2)
                  {
-                   printf("if (!ptr->%s[n]) ptr->%s[n] = (%s**)calloc(%s[n], sizeof(ptr->%s[n][0]));\n", 
+                   printf("if (!ptr->%s[n]) ptr->%s[n] = (%s**)xcalloc(%s[n], sizeof(ptr->%s[n][0]));\n", 
                           id, 
                           id,
                           type,
@@ -374,20 +376,6 @@ enum_list:
 
 
 
-
-name:
-       NAME
-       {
-         printf("Got %s\n", word);
-       }
-       ;
-
-
-  
-
-
-
-
 %%
 /* four modes
 
@@ -396,8 +384,6 @@ name:
    -o write functions to swap into sysroff format out
    -c write code to print info in human form */
 
-#include <stdio.h>
-#include <stdlib.h>
 int yydebug;
 char writecode;
 
@@ -420,7 +406,10 @@ if (writecode == 'd')
 return 0;
 }
 
-int yyerror()
+int
+yyerror(s)
+     char *s;
 {
-  printf("Error twathead\n");
+  fprintf(stderr, "%s\n" , s);
+  return 0;
 }