File: usage.cc

package info (click to toggle)
bisonc%2B%2B 6.09.02-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,984 kB
  • sloc: cpp: 9,375; ansic: 1,505; fortran: 1,134; makefile: 1,062; sh: 526; yacc: 84; lex: 60
file content (211 lines) | stat: -rw-r--r-- 7,433 bytes parent folder | download
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
#include "main.ih"

namespace {

char const *a_optionsDescription = R"( [OPTIONS] file
Where:
  [OPTIONS] - zero or more optional arguments (int options between
              parentheses. Short options require arguments if their long
              option variants do too).

   --analyze-only (-A): 
           only analyze the grammar; except for possibly the verbose grammar
           description file no files are written.

   --baseclass-header=<header> (-b):
           filename holding the base class definition.

   --baseclass-preinclude=<header> (-H):
           preinclude header in the base-class header file.  Use [header] to
           include <header>, otherwise \"header\" will be included.

   --baseclass-skeleton=<skeleton> (-B):
           location of the baseclass header skeleton.

   --class-header=<header> (-c):
           filename holding the parser class definition.

   --class-name=<name>:
           the name of the generated C++ class.

   --class-skeleton=<skeleton> (-C):
           location of the class header skeleton.

   --construction:
           write details about the grammar analysis to stdout.

   --debug:
           generates debug output statements in the generated parse
           function's source.

   --default-actions=<off|quiet|warn|std> (-d):
           unless 'off', add a $$ = $1 action block to production rules not
           defining final action blocks.

   --error-verbose:
           the parse function will dump the parser's state stack to stdout
           when a syntactic error is reported

   --filenames=<filename> (-f):
           filename of output files (overruling the default filename).

   --flex:
           use the traditional `flex' interface.

   --help (-h):
           produce this information (and terminate).

   --implementation-header=<header> (-i):
           filename holding the implementation header.

   --implementation-skeleton=<skeleton> (-I):
           location of the implementation header skeleton.

   --insert-stype:
           show selected semantic values in the output generated by
           --debug. Ignored unless --debug was specified.

   --max-inclusion-depth=<value>:
           sets the maximum number of nested grammar files (default: 10).

   --namespace=<namespace> (-n):
           define the parser in the mentioned namespace.

   --no-baseclass-header:
           don't create the parser's base class header.

   --no-decoration (-D):
           do not include the user-defined actions when generating the
           parser's tt(parse) member.

   --no-lines:
           don't put #line directives in generated output, overruling the 
           %lines directive.

   --no-parse-member:
           don't create the member parse().

   --own-debug:
           bisonc++ displays the actions of its parser while processing
           its input file(s) (implies --verbose).

   --own-tokens (-T):
           bisonc++ displays the tokens and corresponding matched text,
           received from its lexcial scanner.

   --parsefun-skeleton=<parserskel> (-P):
           location of the parse function's skeleton.

   --parsefun-source=<source> (-p):
           filename holding the parse function's source.

   -Q      stop after merely parsing the grammar.

   --polymorphic-code-skeleton=<skeleton> (-L):
           location of the non-inline polymorphic functions skeleton.

   --polymorphic-skeleton=<skeleton> (-M):
           location of the polymorphic semantic values skeleton.

   --print-tokens (-t):
           the print() member of the generated parser class displays the
           tokens and their corresponding matched text.

   --prompt:
           in combination with --debug: show a prompt before performing the
           next parse-cycle (caveat: the lexical scanner should not read from
           the standard input).

   --required-tokens=<value>:
           minimum number of successfully processed tokens between errors
           (default: 0).

   --scanner=<header-file> (-s):
           include `header-file' declaring the class Scanner, and call
           d_scanner.yylex() from Parser::lex().

   --scanner-class-name=<scanner class name>:
           specifies the name of the scanner class: this option is only
           interpreted if --scanner (or %scanner) is also used.

   --scanner-debug:
           extensive display of the actions of bisonc++'s scanner

   --scanner-matched-text-function=<function call>:
           specifies the function to call returning the text matched by the
           lexical scanner when returning a token

   --scanner-token-function=<scanner token function>:
           specifies the function to call by the parser's lex() function
           returning the next token returned by the lexcial scanner (by
           default d_scanner.yylex() when --scanner is used)

   --show-filenames:
           show the names of the used/generated files on the standard error
           stream.

   --skeleton-directory=<skeleton-directory> (-S):
           location of the skeleton directory.

   --tag-mismatches=<off|on>:
           unless 'off', issue a warning if no $$ statement was detected in an
           action block, or if no default $$ = $1 action can be added to a
           production rule without final action block, or if run-time a
           tag-mismatch is observed.

   --target-directory=<pathname>:
           pathname defines the directory where generated files should be
           written. By default this is the directory where bisonc++ is called.

   --thread-safe:
           provide thread-safe access by polymorphic semantic values to the
           generated code's error-counter.

   --token-class=classname (-K)
           Classname defines the name of the Tokens class  that  is  defined
           when  token-path  (see  below)  is specified. If token-path isn't
           specified then this option is ignored. By default the class name
           Tokens is used.
 
   --token-namespace=namespace (-N)
           If token-path is specified then namespace defines the namespace of
           the Tokens class. By default no namespace is used. 
 
   --token-path=pathname (-F)
           Pathname  defines the path name of the file to contain the struct
           Tokens defining the enumeration Tokens_ containing  the  symbolic
           tokens  of the generated grammar. By  default the tokens are
           defined as the enum Tokens_ in the ParserBase class. If  pathname 
           doesn't exist it is created by bisonc++. If the pathname file 
           already exists it is rewritten at each new run of bisonc++.
 
   --usage: produce this information (and terminate).

   --verbose (-V):
           generate verbose description of the analyzed grammar. 

   --version (-v):
)";


}   // anonymous namespace

void usage(string const &program_name)
{
    cout << 
    "\n" <<
    program_name << " by Frank B. Brokken (f.b.brokken@rug.nl)\n"
    "\n"
    "LALR(1) Parser Generator V "  << version << "\n"
    "Copyright (c) GPL " << year << ". NO WARRANTY.\n"
    "Designed after `bison++' (1.21.9-1) by Alain Coetmeur "
                                                "<coetmeur@icdc.fr>\n"
    "\n"
    "Usage: " << program_name << a_optionsDescription <<
    "           display " << program_name << "'s version and terminate.\n"
                                                                << std::endl;
}