OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [classpath/] [tools/] [gnu/] [classpath/] [tools/] [javah/] [GcjhMain.java] - Blame information for rev 779

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 779 jeremybenn
/* GcjhMain.java - gcjh main program
2
 Copyright (C) 2007 Free Software Foundation, Inc.
3
 
4
 This file is part of GNU Classpath.
5
 
6
 GNU Classpath is free software; you can redistribute it and/or modify
7
 it under the terms of the GNU General Public License as published by
8
 the Free Software Foundation; either version 2, or (at your option)
9
 any later version.
10
 
11
 GNU Classpath is distributed in the hope that it will be useful, but
12
 WITHOUT ANY WARRANTY; without even the implied warranty of
13
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14
 General Public License for more details.
15
 
16
 You should have received a copy of the GNU General Public License
17
 along with GNU Classpath; see the file COPYING.  If not, write to the
18
 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19
 02110-1301 USA.
20
 
21
 Linking this library statically or dynamically with other modules is
22
 making a combined work based on this library.  Thus, the terms and
23
 conditions of the GNU General Public License cover the whole
24
 combination.
25
 
26
 As a special exception, the copyright holders of this library give you
27
 permission to link this library with independent modules to produce an
28
 executable, regardless of the license terms of these independent
29
 modules, and to copy and distribute the resulting executable under
30
 terms of your choice, provided that you also meet, for each linked
31
 independent module, the terms and conditions of the license of that
32
 module.  An independent module is a module which is not derived from
33
 or based on this library.  If you modify this library, you may extend
34
 this exception to your version of the library, but you are not
35
 obligated to do so.  If you do not wish to do so, delete this
36
 exception statement from your version. */
37
 
38
 
39
package gnu.classpath.tools.javah;
40
 
41
import gnu.classpath.tools.common.ClasspathToolParser;
42
 
43
import gnu.classpath.tools.getopt.Option;
44
import gnu.classpath.tools.getopt.OptionException;
45
import gnu.classpath.tools.getopt.OptionGroup;
46
 
47
import java.io.IOException;
48
import java.util.ArrayList;
49
 
50
public class GcjhMain extends Main
51
{
52
  ArrayList<Text> commands = new ArrayList<Text>();
53
 
54
  public GcjhMain()
55
  {
56
    cni = true;
57
  }
58
 
59
  protected String getName()
60
  {
61
    return "gcjh";
62
  }
63
 
64
  protected ClasspathToolParser getParser()
65
  {
66
    ClasspathToolParser result = super.getParser();
67
 
68
    result.setHeader("usage: gcjh [OPTION]... CLASS...");
69
 
70
    OptionGroup text = new OptionGroup("CNI text options");
71
    text.add(new Option("add", "Insert TEXT into class body", "TEXT")
72
      {
73
        public void parsed(String arg) throws OptionException
74
        {
75
          commands.add(new Text(Text.ADD, arg));
76
        }
77
      });
78
    text.add(new Option("append", "Append TEXT after class declaration",
79
                        "TEXT")
80
      {
81
        public void parsed(String arg) throws OptionException
82
        {
83
          commands.add(new Text(Text.APPEND, arg));
84
        }
85
      });
86
    text.add(new Option("friend", "Insert TEXT as a 'friend' declaration",
87
                        "TEXT")
88
      {
89
        public void parsed(String arg) throws OptionException
90
        {
91
          commands.add(new Text(Text.FRIEND, arg));
92
        }
93
      });
94
    text.add(new Option("prepend", "Insert TEXT before start of class", "TEXT")
95
      {
96
        public void parsed(String arg) throws OptionException
97
        {
98
          commands.add(new Text(Text.PREPEND, arg));
99
        }
100
      });
101
    result.add(text);
102
 
103
    OptionGroup compat = new OptionGroup("Compatibility options (unused)");
104
    // gcjh itself had compatibility options -old and -trace.  I
105
    // didn't add them here since they should really be unused by now.
106
    compat.add(new Option("td", "Unused compatibility option", "DIRECTORY")
107
      {
108
        public void parsed(String arg) throws OptionException
109
        {
110
        }
111
      });
112
    // I don't believe anyone ever used these options.
113
    compat.add(new Option("M", "Unused compatibility option")
114
      {
115
        public void parsed(String arg) throws OptionException
116
        {
117
        }
118
      });
119
    compat.add(new Option("MM", "Unused compatibility option")
120
      {
121
        public void parsed(String arg) throws OptionException
122
        {
123
        }
124
      });
125
    compat.add(new Option("MD", "Unused compatibility option")
126
      {
127
        public void parsed(String arg) throws OptionException
128
        {
129
        }
130
      });
131
    compat.add(new Option("MMD", "Unused compatibility option")
132
      {
133
        public void parsed(String arg) throws OptionException
134
        {
135
        }
136
      });
137
 
138
    result.add(compat);
139
 
140
    return result;
141
  }
142
 
143
  protected void postParse(String[] names)
144
  {
145
    for (int i = 0; i < names.length; ++i)
146
      textMap.put(names[i].replace('.', '/'), commands);
147
  }
148
 
149
  public static void main(String[] args) throws IOException
150
  {
151
    new GcjhMain().run(args);
152
  }
153
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.