~ubuntu-branches/ubuntu/utopic/gccgo-go/utopic

« back to all changes in this revision

Viewing changes to src/cmd/gc/mkopnames

  • Committer: Package Import Robot
  • Author(s): James Page
  • Date: 2014-01-27 09:18:55 UTC
  • Revision ID: package-import@ubuntu.com-20140127091855-zxfshmykfsyyw4b2
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# Copyright 2009 The Go Authors. All rights reserved.
 
3
# Use of this source code is governed by a BSD-style
 
4
# license that can be found in the LICENSE file.
 
5
 
 
6
# Disable colored grep if user has it set to --color=always.
 
7
# (Arguably user error.)
 
8
export GREP_OPTIONS=""
 
9
 
 
10
echo '// auto generated by mkopnames'
 
11
echo 'static char*'
 
12
echo 'opnames[] = '
 
13
echo '{'
 
14
sed -n '/OXXX/,/OEND/p' go.h |
 
15
        cpp |
 
16
        sed 's!//.*!!; /^#/d'  |
 
17
        tr ' ' '\012' |
 
18
        tr -d ' \011,' |
 
19
        grep . |
 
20
        sort |
 
21
        grep -v '^OEND$' |
 
22
        sed 's/O//; s/.*/       [O&] =  "&",/'
 
23
echo '};'
 
24