Commit b3d88d64 authored by Frank B. Brokken's avatar Frank B. Brokken

New upstream version 6.02.00

parent b7571223
......@@ -106,14 +106,14 @@ NOTE: the parser-class header file generated by bisonc++ before version
void errorRecovery();
int lookup(bool recovery);
void nextToken();
void print__();
void exceptionHandler__(std::exception const &exc);
void print_();
void exceptionHandler_(std::exception const &exc);
The function print__) is defined by bisonc++, the default implementation
of exceptionHandler__() can be added to the parser's internal header
The function print_) is defined by bisonc++, the default implementation
of exceptionHandler_() can be added to the parser's internal header
file:
inline void Parser::exceptionHandler__(std::exception const &exc)
inline void Parser::exceptionHandler_(std::exception const &exc)
{
throw; // optionally re-implement to handle exceptions thrown
// by actions
......
enum class Tag__
enum class Tag_
defines the tags that are associated with the various semantic value
types. Examples of tags:
......@@ -6,26 +6,26 @@ enum class Tag__
VECTOR,
TEXTTYPE,
namespace Meta__
namespace Meta_
1. defines struct templates TagOf that, when provided with the actual data
types, provide the associated Tag__ as
types, provide the associated Tag_ as
TagOf<data-type>::tag
Example:
template <>
struct TagOf<FlexTypes::TextType>
{
static Tag__ const tag = Tag__::TEXTTYPE;
static Tag_ const tag = Tag_::TEXTTYPE;
};
2. defines struct templates TypeOf that, when provided with a tag,
provides the associated data type as
typename TypeOf<Tag__>::type
typename TypeOf<Tag_>::type
Example:
template <>
struct TypeOf<Tag__::VECTOR>
struct TypeOf<Tag_::VECTOR>
{
typedef std::vector<std::string> type;
};
......@@ -41,19 +41,19 @@ to offsets.
Class organization and inner working of polymorphic values
==========================================================
During a short time interval the Meta__ class Base implemented polymorphic
During a short time interval the Meta_ class Base implemented polymorphic
behavior without using virtual members. Although this is possible, it also
results in a somewhat artificial implementation, as C++ offers a clean
definition and implentation of polymorphism. Therefore, shortly after
releasing bisonc++ 5.00.00 bisonc++ now generates a standard polymorphic
implementation of the class Meta__::Base.
implementation of the class Meta_::Base.
The class Meta__::Base has the following interface:
The class Meta_::Base has the following interface:
class Base
{
protected:
Tag__ d_baseTag; // The tag is assigned by Semantic.
Tag_ d_baseTag; // The tag is assigned by Semantic.
public:
Base();
......@@ -61,7 +61,7 @@ The class Meta__::Base has the following interface:
virtual ~Base();
Tag__ tag() const;
Tag_ tag() const;
Base *clone() const;
void *data() const;
......@@ -70,11 +70,11 @@ The class Meta__::Base has the following interface:
virtual Base *vClone() const;
};
Base is used as Semantic<Tag__> class template's base class, where the various
Base is used as Semantic<Tag_> class template's base class, where the various
semantic value types are distinguished by their associated
Tags. Semantic<Tag__>'s interface is:
Tags. Semantic<Tag_>'s interface is:
template <Tag__ tg_>
template <Tag_ tg_>
class Semantic: public Base
{
typedef typename TypeOf<tg_>::type SemType;
......@@ -92,7 +92,7 @@ Tags. Semantic<Tag__>'s interface is:
void *vData() const override;
};
Semantic<Tag__> implementations implement a wrapper class around the various
Semantic<Tag_> implementations implement a wrapper class around the various
semantic values. Each instantiation offers a SemType semantic value data type
(explicitly defined here to simplify references to it) and a SemType d_data
member.
......@@ -103,11 +103,11 @@ Semantic(Params)'s constructor, perfectly forwarding its arguments to d_data's
constructor.
The generated parser's STYPE__ is the class Meta__::SType. It is a wrapper
The generated parser's STYPE_ is the class Meta_::SType. It is a wrapper
aound a Base *d_base data member. The d_base pointer either points to a plain
Base object (not offering any usable data, but simplifying SType's
implementation somewhat because tests for 0-pointers can be omitted) ) or to a
Semantic<Tag__> object, containing an associated SemType value. Meta__::SType
Semantic<Tag_> object, containing an associated SemType value. Meta_::SType
offers this interface:
class SType
......@@ -130,16 +130,16 @@ offers this interface:
template <typename Type>
SType &operator=(Type const &value);
template <Tag__ tag, typename ...Args>
template <Tag_ tag, typename ...Args>
void assign(Args &&...args);
template <Tag__ tag>
template <Tag_ tag>
typename TypeOf<tag>::type &get();
template <Tag__ tag>
template <Tag_ tag>
typename TypeOf<tag>::type const &get() const;
Tag__ tag() const;
Tag_ tag() const;
bool valid() const;
......@@ -151,20 +151,20 @@ objects can be constructed by default (initializing d_base to point to a Base
object), from an existing SType object, or from an existing SemType object, in
which case d_base will point to a new, copy constructed SemType. In the latter
case Type must be a defined polymorphic semantic type, as this allows the
compiler to deduct the correct Tag__. If raw arguments are available from
compiler to deduct the correct Tag_. If raw arguments are available from
which a SemType can be constructed the assign member can be used, which
requires an explicit Tag__ template value argument.
requires an explicit Tag_ template value argument.
The two get members call the same Base::data member. This member calls the
virtual member vData, returning the SemType value stored in the
Semantic<Tag__> object to where d_base points, or throwing an
Semantic<Tag_> object to where d_base points, or throwing an
exception. Once the SType object goes out of scope it calls delete d_base,
destroying the object to where d_base points.
// The class SType wraps a pointer to Base. It becomes the polymorphic
// STYPE__ type It also defines a get member, allowing constructions like
// STYPE_ type It also defines a get member, allowing constructions like
// $$.get<INT> to be used. Instantiations of its operator= member
// template are used to assign semantic values to the SType object.
......
#define VERSION "6.01.03"
#define VERSION "6.02.00"
#define YEARS "2005-2018"
This diff is collapsed.
bisonc++ (6.02.00)
* Starting with version 6.02.00 bisonc++ reserved identifiers no longer end
in two underscore characters, but in one. This modification was necessary
because according to the C++ standard identifiers having two or more
consecutive underscore characters are reserved by the language. In
practice this could require some minor modifications of existing source
files using bisonc++'s facilities, most likely limited to changing
Tokens__ into Tokens_ and changing Meta__ into Meta_.
The complete list of affected names is:
Enums: DebugMode_, ErrorRecovery_, Return_, Tag_, Tokens_;
Enum values: PARSE_ABORT_, PARSE_ACCEPT_, UNEXPECTED_TOKEN_, sizeofTag_;
Type / namespace designators: Meta_, PI_, STYPE_;
Member functions: clearin_, errorRecovery_, errorVerbose_, executeAction_,
lex_, lookup_, nextCycle_, nextToken_, popToken_, pop_, print_,
pushToken_, push_, recovery_, redoToken_, reduce_, savedToken_,
shift_, stackSize_, startRecovery_, state_, token_, top_, vs_,
Protected data members: d_acceptedTokens_, d_actionCases_, d_debug_,
d_nErrors_, d_requiredTokens_, d_val_, idOfTag_, s_nErrors_
-- Frank B. Brokken <f.b.brokken@rug.nl> Tue, 15 May 2018 20:58:45 +0200
bisonc++ (6.01.03)
* To avoid lintian reports about missing examples the 'examples/'
......
......@@ -41,9 +41,9 @@
// #include <FlexLexer.h>
// ...
#ifndef __FLEX_LEXER_H
#ifndef _FLEX_LEXER_H
// Never included before - need to define base class.
#define __FLEX_LEXER_H
#define _FLEX_LEXER_H
#include <iostream.h>
#include "MyParser.h"
extern "C++" {
......
......@@ -155,8 +155,8 @@ generated by bic() versions before 6.00.00.
Bic() version 6.00.00 generates code that significantly differs from code
generated by earlier versions. The identifiers of all members (both data and
functions) that are generated by bic() and accessible to the generated
parser-class end in two underscore characters. Member functions whose
identifiers end in two underscores are `owned' by bic(), are rewritten each
parser-class end in an underscore character. Member functions whose
identifiers end in an underscore are `owned' by bic(), are rewritten each
time bic() is run, and should not be modified. Some members are defined as
members of the generated parser-class, and are declared in the parser class
header file (e.g., tt(parser.h)) and some members are given default
......@@ -171,16 +171,16 @@ modifications:
default implementation is provided in the parser's internal header file. The
current implementation directly inserts the text tt(Syntax error) into the
standard output stream;
itt(void exceptionHandler__(std::exception const &exc)) was changed to
itt(void exceptionHandler_(std::exception const &exc)) was changed to
tt(void exceptionHandler(std::exception const &exc)). A
default implementation is provided in the parser's internal header file, and
only its trailing underscore characters need to be removed;
itt(int lookup(bool recovery)): remove this member declaration from the
previously generated parser class;
it() The following members are declared without two trailing underscore
characters in the generated parser class. Two underscore characters should
it() The following members are declared without a trailing underscore
character in the generated parser class. An underscore character should
be added to their identifiers: tt(executeAction, errorRecovery, nextToken).
it() The member tt(void nextCycle__()) must be declared in the private
it() The member tt(void nextCycle_()) must be declared in the private
section of the generated parser class.
)
......@@ -189,8 +189,8 @@ accessible to the parser class. Bic() version 6.00.00 restricts access to
those members. They can still be read, but no longer modified by the parser
class. This applies to the following members:
itemization(
itt(d_token__): use tt(int token__()) instead;
itt(d_state__): use tt(size_t state__()) instead;
itt(d_token_): use tt(int token_()) instead;
itt(d_state_): use tt(size_t state_()) instead;
)
manpagesection(OPTIONS)
......@@ -290,10 +290,10 @@ manpagesection(FILES)
was specified.
it() bf(debugfunctions1.in): skeleton defining the members declared in
tt(debugdecl.in).
it() bf(debugfunctions2.in): skeleton implementing tt(symbol__), which is
it() bf(debugfunctions2.in): skeleton implementing tt(symbol_), which is
only needed when the tt(print-tokens) option or directive was
specified.
it() bf(debugfunctions3.in): skeleton implementing tt(errorVerbose__),
it() bf(debugfunctions3.in): skeleton implementing tt(errorVerbose_),
which is only needed when the tt(error-verbose) option or directive was
specified.
it() bf(debugincludes.in): skeleton specifying the header files
......@@ -305,7 +305,7 @@ manpagesection(FILES)
it() bf(lex.in): skeleton implementing the tt(Parser::lex) function.
it() bf(ltypedata.in): skeleton declaring the location variables
it() bf(ltype.in): skeleton defining the default or user defined
tt(LTYPE__).
tt(LTYPE_).
it() bf(print.in): skeleton implementing the actions of tt(Parser::print)
if the tt(print-tokens) option or directive was specified.
)
......@@ -325,7 +325,7 @@ manpagesection(BUGS)
To avoid collisions with names defined by the parser's (base) class, the
following identifiers should not be used as token names:
itemization(
it() Identifiers ending in two underscores;
it() Identifiers ending in an underscore;
it() Any of the following identifiers: tt(ABORT, ACCEPT, ERROR,
debug, error), or tt(setDebug).
)
......
......@@ -72,9 +72,9 @@ the following sections:
it() bf(AUTHOR): at the end of this man-page.
)
All identifiers ending in two underscore characters are reserved for
bic(). Member functions ending in two underscore characters must not be
redefined. Data members ending in two underscore characters are available in
All identifiers ending in an underscore character are reserved for
bic(). Member functions ending in an underscore character must not be
redefined. Data members ending in an underscore character are available in
the generated parser class, and may be modified by user-defined members of the
parser class. Some members like (tt(error, exceptionHandler, lex)) are defined
in the parser class and must remain present, but their implementations may be
......@@ -82,6 +82,10 @@ altered by the user. Members for which no default implementation is provided
in the parser's internal header file (e.g., tt(Parser.ih)) may not be
redefined or masked by user-provided code.
manpagesection(UNDERSCORES)
includefile(../manual/underscores.yo)
manpagesection(PUBLIC SYMBOLS)
includefile(../manual/class/public.yo)
......@@ -100,21 +104,21 @@ manpagesection(PRIVATE DATA MEMBERS)
generated by bic(). All data members are actually protected members inherited
from the parser's base class.
itemization(
it() bf(size_t d_acceptedTokens__):nl()
it() bf(size_t d_acceptedTokens_):nl()
Counts the number of accepted tokens since the start of the tt(parse())
function or since the last detected syntactic error. It is initialized
to tt(d_requiredTokens__) to allow an early error to be detected as
to tt(d_requiredTokens_) to allow an early error to be detected as
well.
it() bf(bool d_actionCases__):nl()
it() bf(bool d_actionCases_):nl()
When the tt(debug) option has been specified, this variable (tt(false)
by default) determines whether the number of action block which is
about to be executed by the parser's member tt(executeAction) will be
displayed to the standard output stream.
it() bf(bool d_debug__):nl()
it() bf(bool d_debug_):nl()
When the tt(debug) option has been specified, this variable (tt(true)
by default) determines whether debug information is actually
displayed.
it() bf(LTYPE__ d_loc__):nl()
it() bf(LTYPE_ d_loc_):nl()
The location type value associated with a terminal token. It can be
used by, e.g., lexical scanners to pass location information of a
matched token to the parser in parallel with a returned token. It is
......@@ -122,41 +126,41 @@ from the parser's base class.
been defined. nl()
Lexical scanners may be offered the facility to assign a value to this
variable in parallel with a returned token. In order to allow a
scanner access to tt(d_loc__), tt(d_loc__)'s address should be passed
scanner access to tt(d_loc_), tt(d_loc_)'s address should be passed
to the scanner. This can be realized, for example, by defining a
member tt(void setLoc(STYPE__ *)) in the lexical scanner, which is
member tt(void setLoc(STYPE_ *)) in the lexical scanner, which is
then called from the parser's constructor as follows:
verb(
d_scanner.setSLoc(&d_loc__);
d_scanner.setSLoc(&d_loc_);
)
Subsequently, the lexical scanner may assign a value to the parser's
tt(d_loc__) variable through the pointer to tt(d_loc__) stored inside
tt(d_loc_) variable through the pointer to tt(d_loc_) stored inside
the lexical scanner.
it() bf(size_t d_nErrors__):nl()
it() bf(size_t d_nErrors_):nl()
The number of errors counted by tt(parse). It is initialized by the
parser's base class initializer, and is updated while tt(parse)
executes. When tt(parse) has returned it contains the total number
of errors counted by tt(parse). Errors are not counted if suppressed
(i.e., if tt(d_acceptedTokens__) is less than tt(d_requiredTokens__)).
(i.e., if tt(d_acceptedTokens_) is less than tt(d_requiredTokens_)).
it() bf(size_t d_requiredTokens__):nl()
it() bf(size_t d_requiredTokens_):nl()
Defines the minimum number of accepted tokens that the tt(parse)
function must have processed before a syntactic error can be
generated.
it() bf(STYPE__ d_val__):nl()
it() bf(STYPE_ d_val_):nl()
The semantic value of a returned token or nonterminal symbol. With
nonterminal tokens it is assigned a value through the action rule's
symbol tt($$). Lexical scanners may be offered the facility to assign
a semantic value to this variable in parallel with a returned
token. In order to allow a scanner access to tt(d_val__),
tt(d_val__)'s address should be passed to the scanner. This can be
realized, for example, by passing tt(d_val__)'s address to the lexical
token. In order to allow a scanner access to tt(d_val_),
tt(d_val_)'s address should be passed to the scanner. This can be
realized, for example, by passing tt(d_val_)'s address to the lexical
scanner's constructor.
Subsequently, the lexical scanner may assign a value to the parser's
tt(d_val__) variable through the pointer to tt(d_val__) stored in a
tt(d_val_) variable through the pointer to tt(d_val_) stored in a
data member of the lexical scanner.
Note that in some cases this approach em(must) be used to make
......@@ -167,7 +171,7 @@ from the parser's base class.
text.
If tt(STYPE) is a polymorphic semantic value, specific requirements for
assigning values to tt(d_val__) apply.
assigning values to tt(d_val_) apply.
IFDEF(MANUAL)((cf. section ref(POLYTYPE)))().
)
......@@ -177,25 +181,25 @@ manpagesection(BUGS)
necessary alternatives are mentioned:
itemization(
it() bf(bool Base::debug() const): use the tt(d_debug__) data member;
it() bf(bool Base::debug() const): use the tt(d_debug_) data member;
it() bf(void error(char const *)): replaced by bf(void error+nop()());
it() bf(void exceptionHandler__(std::exception const &exc)): omit final
it() bf(void exceptionHandler_(std::exception const &exc)): omit the final
underscores: bf(void exceptionHandler(std::exception const
&exc))
it() bf(void executeAction+nop()(int)): add two underscores to the
it() bf(void executeAction+nop()(int)): add one underscore to the
declaration in the parser class interface: bf(void
executeAction__+nop()(int))
executeAction_+nop()(int))
it() bf(int lookup+nop()(bool)): omit this member from the parser class
interface.
it() bf(void nextCycle__+nop()(int)): add this member declaration to the
it() bf(void nextCycle_+nop()(int)): add this member declaration to the
parser class interface.
it() bf(void nextToken+nop()(int)): add two underscores to the declaration
in the parser class interface: bf(void nextToken__+nop()(int))
it() bf(void nextToken+nop()(int)): add one underscore to the declaration
in the parser class interface: bf(void nextToken_+nop()(int))
it() bf(size_t d_nextToken__): removed from the interface.
it() bf(int d_state__): use tt(state__()).
it() bf(int d_token__): use tt(token__()).
it() bf(LTYPE__ d_vsp__): removed from the interface. Use tt(vsp__+nop()())
it() bf(size_t d_nextToken_): removed from the interface.
it() bf(int d_state_): use tt(state_()).
it() bf(int d_token_): use tt(token_()).
it() bf(LTYPE_ d_vsp_): removed from the interface. Use tt(vsp_+nop()())
instead.
)
......
......@@ -89,6 +89,9 @@ This manual page contains the following sections:
it() bf(AUTHOR): at the end of this man-page.
)
manpagesection(UNDERSCORES)
includefile(../manual/underscores.yo)
manpagesection(DIRECTIVES)
......@@ -260,10 +263,10 @@ match. When bic() detects a type mismatches it issues errors.
it() bf(%locationstruct) tt(struct-definition)
Defines the organization of the location-struct data type
tt(LTYPE__). This struct should be specified analogously to the
tt(LTYPE_). This struct should be specified analogously to the
way the parser's stacktype is defined using tt(%union) (see
below). The location struct is named tt(LTYPE__). By default (if
neither tt(locationstruct) nor tt(LTYPE__) is specified) the
below). The location struct is named tt(LTYPE_). By default (if
neither tt(locationstruct) nor tt(LTYPE_) is specified) the
standard location struct (see the next directive) is used:
it() bf(%lsp-needed)
......@@ -271,7 +274,7 @@ match. When bic() detects a type mismatches it issues errors.
This directive results in bic() generating a parser using
the standard location stack. This stack's default type is:
verb(
struct LTYPE__
struct LTYPE_
{
int timestamp;
int first_line;
......@@ -281,11 +284,11 @@ match. When bic() detects a type mismatches it issues errors.
char *text;
};
)
Bic() does em(not) provide the elements of the tt(LTYPE__) struct
Bic() does em(not) provide the elements of the tt(LTYPE_) struct
with values. Action blocks of production rules may refer to the
location stack element associated with a production element using
tt(@) variables, like tt(@1.timestamp, @3.text, @5). The rule's
location struct itself may be referred to as either tt(d_loc__) or
location struct itself may be referred to as either tt(d_loc_) or
tt(@@).
it() bf(%ltype typename)
......@@ -295,7 +298,7 @@ match. When bic() detects a type mismatches it issues errors.
type (e.g., tt(size_t)). It should not be used if a
tt(%locationstruct) specification is defined (see below). Within
the parser class, this type is available as the type
`tt(LTYPE__)'. All text on the line following tt(%ltype) is used
`tt(LTYPE_)'. All text on the line following tt(%ltype) is used
for the tt(typename) specification. It should therefore not
contain comment or any other characters that are not part of the
actual type definition.
......@@ -321,7 +324,7 @@ match. When bic() detects a type mismatches it issues errors.
dollar-indices are commonly used to implement inherited
attributes, and should normally be avoided. When used, they can be
specified like tt($-1), or like tt($<type>-1), where tt(type) is
empty; an tt(STYPE__) tag; or a field-name. However, note that in
empty; an tt(STYPE_) tag; or a field-name. However, note that in
combination with the tt(%polymorphic) directive (see below) only
the tt($-i) format can be used.
......@@ -393,7 +396,7 @@ production rule's priority. A well known application of tt(%prec) is:
it() bf(%print-tokens)
The tt(print) directive provides an implementation of the Parser
class's tt(print__) function displaying the current token value
class's tt(print_) function displaying the current token value
and the text matched by the lexical scanner as received by the
generated tt(parse) function.
......@@ -508,7 +511,7 @@ production rule's priority. A well known application of tt(%prec) is:
mutually exclusive directives.
Within the parser class, the semantic value type is available as
the type `tt(STYPE__)'. All text on the line following tt(%stype)
the type `tt(STYPE_)'. All text on the line following tt(%stype)
is used for the tt(typename) specification. It should therefore
not contain comment or any other characters that are not part of
the actual type definition.
......@@ -569,14 +572,14 @@ grammar's action block the error was encountered.
it() bf(%union) tt(union-definition)
Acts identically to the identically named bf(bison) and bf(bison++)
declaration. Bic() generates a union, named tt(STYPE__), as its
declaration. Bic() generates a union, named tt(STYPE_), as its
semantic type.
it() bf(%weak-tags)
This directive is ignored unless the tt(%polymorphic)
directive was specified. It results in the declaration of tt(enum
Tag__) rather than tt(enum class Tag__). When in doubt, don't use
Tag_) rather than tt(enum class Tag_). When in doubt, don't use
this directive.
)
......@@ -638,28 +641,28 @@ elements are placed inside the namespace that is specified by the
tt(%namespace) directive):
itemization(
it() All semantic value type identifiers are collected in a strongly typed
`tt(Tag__)' enumeration. E.g.,
`tt(Tag_)' enumeration. E.g.,
verb(
enum class Tag__
enum class Tag_
{
INT,
STRING,
VECT
};
)
it() An anonymous tt(enum) defining the symbolic constant tt(sizeofTag__)
equal to the number of tags in the tt(Tag__) enumeration.
it() An anonymous tt(enum) defining the symbolic constant tt(sizeofTag_)
equal to the number of tags in the tt(Tag_) enumeration.
it() The namespace tt(Meta__) contains almost all of the code
it() The namespace tt(Meta_) contains almost all of the code
implementing polymorphic values.
)
The namespace tt(Meta__) contains, among other classes the class tt(SType).
The parser's semantic value type tt(STYPE__) is equal to tt(Meta__::SType).
The namespace tt(Meta_) contains, among other classes the class tt(SType).
The parser's semantic value type tt(STYPE_) is equal to tt(Meta_::SType).
bf(STYPE__ equals Meta__::SType)
bf(STYPE_ equals Meta_::SType)
tt(Meta__::SType) provides the standard user interface for using polymorphic
tt(Meta_::SType) provides the standard user interface for using polymorphic
semantic data types. It declares the following public interface:
includefile(../manual/grammar/stypeinterface)
......@@ -685,7 +688,7 @@ manpagesection(RESTRICTIONS ON TOKEN NAMES)
To avoid collisions with names defined by the parser's (base) class, the
following identifiers should not be used as token names:
itemization(
it() Identifiers ending in two underscores;
it() Identifiers ending in an underscore;
it() Any of the following identifiers: tt(ABORT, ACCEPT, ERROR, clearin,
debug), or tt(setDebug).
)
......
......@@ -27,11 +27,11 @@ class Parser: public ParserBase
void done();
// support functions for parse():
void executeAction__(int ruleNr);
void errorRecovery__();
void nextCycle__();
void nextToken__();
void print__();
void executeAction_(int ruleNr);
void errorRecovery_();
void nextCycle_();
void nextToken_();
void print_();
void exceptionHandler(std::exception const &exc);
};
......
......@@ -19,7 +19,7 @@ inline int Parser::lex()
inline void Parser::print()
{
print__(); // displays tokens if --print was specified
print_(); // displays tokens if --print was specified
}
inline void Parser::exceptionHandler(std::exception const &exc)
......
......@@ -12,7 +12,7 @@
namespace // anonymous
{
struct PI__;
struct PI_;
}
......@@ -20,7 +20,7 @@ namespace // anonymous
class ParserBase
{
public:
enum DebugMode__
enum DebugMode_
{
OFF = 0,
ON = 1 << 0,
......@@ -30,7 +30,7 @@ class ParserBase
// $insert tokens
// Symbolic tokens:
enum Tokens__
enum Tokens_
{
NUMBER = 257,
EOLN,
......@@ -38,47 +38,47 @@ class ParserBase
};
// $insert STYPE
typedef int STYPE__;
typedef int STYPE_;
private:
// state semval
typedef std::pair<size_t, STYPE__> StatePair;
typedef std::pair<size_t, STYPE_> StatePair;
// token semval
typedef std::pair<int, STYPE__> TokenPair;
typedef std::pair<int, STYPE_> TokenPair;
int d_stackIdx = -1;
std::vector<StatePair> d_stateStack;
protected:
enum Return__
enum Return_
{
PARSE_ACCEPT__ = 0, // values used as parse()'s return values
PARSE_ABORT__ = 1
PARSE_ACCEPT_ = 0, // values used as parse()'s return values
PARSE_ABORT_ = 1
};
enum ErrorRecovery__
enum ErrorRecovery_
{
DEFAULT_RECOVERY_MODE__,
UNEXPECTED_TOKEN__,
DEFAULT_RECOVERY_MODE_,
UNEXPECTED_TOKEN_,
};
bool d_actionCases__ = false; // set by options/directives
bool d_debug__ = true;
size_t d_requiredTokens__;
bool d_actionCases_ = false; // set by options/directives
bool d_debug_ = true;
size_t d_requiredTokens_;
size_t d_nErrors__; // initialized by clearin()</