File: ytab.sed

package info (click to toggle)
ruby2.1 2.1.5-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie-kfreebsd
  • size: 59,972 kB
  • sloc: ruby: 625,579; ansic: 295,220; xml: 25,445; yacc: 9,155; lisp: 2,433; tcl: 949; makefile: 535; sh: 402; perl: 62; python: 47; awk: 36; asm: 35; sed: 31
file content (37 lines) | stat: -rwxr-xr-x 615 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sed -f
/^int yydebug;/{
i\
#ifndef yydebug
a\
#endif
}
/^extern int yydebug;/{
i\
#ifndef yydebug
a\
#endif
}
/^yydestruct.*yymsg/,/#endif/{
  /^yydestruct/{
    /parser/!{
      h
      s/^/ruby_parser_&/
      s/)$/, parser)/
      /\*/s/parser)$/struct parser_params *&/
    }
  }
  /^#endif/{
    x
    /^./{
      i\
    struct parser_params *parser;
      a\
#define yydestruct(m, t, v) ruby_parser_yydestruct(m, t, v, parser)
    }
    x
  }
}
s/^\([ 	]*\)\(yyerror[ 	]*([ 	]*parser,\)/\1parser_\2/
s!^ *extern char \*getenv();!/* & */!
s/^\(#.*\)".*\.tab\.c"/\1"parse.c"/
/^\(#.*\)".*\.y"/s:\\\\:/:g