1 04/24/85 lalrp, lalr_parse, new_lalrp
2
3 Syntax: new_lalrp path source control_args
4
5
6 Function: provides a means for testing an LALR produced parser
7 table and the associated scanner and semantics routines.
8 This program is an adequate parser in many applications.
9
10
11 Arguments:
12 path
13 is the pathname of the result segment generated when the
14 grammar was processed. The grammar or result suffix is
15 assumed if not supplied. This argument may be an archive
16 component pathname.
17 source
18 is the pathname of the sample input source segment to be
19 parsed. If not supplied, lines will be read from user_input.
20 This is true of the default scanner. If your own scanner is
21 supplied, it must provide for reading user_input if no source
22 is specified, or it must report an error. This argument may
23 be an archive component pathname.
24
25
26 Control arguments:
27 -defer
28 causes calls to the semantics procedure to be deferred until
29 a read transition is about to be made, an empty production is
30 about to be applied, or the final state is reached. Default
31 -no_defer
32 causes semantic actions to be performed as soon as the
33 productions are recognized.
34 -local_reads N, -lr N
35 requires the parser's local recovery facility see Chapter 7
36 Error Recovery to accept N symbols beyond the bad symbol in
37 order for a particular recovery to be considered successful.
38 N must be in the range 1 to 9. The default is 2.
39 -max_recover N, -mr N
40 allows the parser to perform at most N local recoveries see
41 Chapter 7 Error Recovery in succession. If N is zero,
42 local recovery is disabled. The default is 1.
43
44
45 -print, -pr
46 causes each line from source to be printed with line
47 numbers as it is scanned. This is true of the default
48 scanner. If your own scanner is supplied, it determines
49 whether or not printing is available.
50 -no_print, -npr
51 does not print the source as it is scanned. Default
52 -recovery
53 is the same as -max_recover 1.
54 -no_recovery, -nr
55 is the same as -max_recover 0.
56 -scanner P, -scan P
57 specifies the pathname of a scanner procedure which
58 corresponds to the grammar. The scanner procedure must have
59 entry points named E and init. A default scanner,
60 lalr_scanner_, is provided.
61
62
63 -semantics P, -sem P
64 enables calls to the semantic actions. If the grammar's
65 source is in the embedded semantics format, the pathname of a
66 semantics segment which corresponds to the grammar must be
67 given by P and this segment must have an entry point named E.
68 It is this entry point which is called to perform a semantic
69 action. If the grammar's source is in the separate semantics
70 format, P may be given; however, its only use is to specify an
71 initialization entry point as discussed in the interface
72 description below. In the separate semantics format the
73 result segment contains the names of any semantic routines to
74 be called.
75 -no_semantics, -nsem
76 disables calls to the semantics actions. Default
77
78
79 -skip_depth N, -sd N
80 specifies that skip recovery see Chapter 7 Error Recovery
81 in the LALR Manual shall not make more than N attempts, each
82 from deeper in the parse stack, to recover after discarding a
83 particular skip symbol.
84 -skip_reads N, -sr N
85 specifies that skip recovery see Chapter 7 Error Recovery
86 must be able to accept the next N input symbols following a
87 skip symbol in order to recover following the skip symbol.
88 If fewer than N symbols can be accepted, skipping continues
89 until another skip symbol is found. N must be in
90 the range 1 to 9.
91 -trace
92 causes a trace of the parsing and error recovery procedures
93 to be printed.
94 -no_trace
95 does not trace the execution of the parsing and error
96 recovery procedures. Default
97
98
99 Notes:
100 P represents a pathname, other than an archive component
101 pathname, with an entryname portion of E; if P is given as a
102 simple name, it is found according to the search rules.
103
104 The use of the -defer argument usually improves the parser's
105 ability to perform local error recovery but the performance of
106 the semantics actions becomes some what unsynchronized with
107 respect to the reading of the symbols by the scanner procedure.