[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
doc: reorder C++ sections
From: |
Akim Demaille |
Subject: |
doc: reorder C++ sections |
Date: |
Sat, 20 Oct 2018 14:13:57 +0200 |
Only the order changed, nothing else.
commit 16d34d8036d84242ed3358782e942a5f5a9eca52
Author: Akim Demaille <address@hidden>
Date: Sat Oct 20 13:59:08 2018 +0200
doc: reorder C++ sections
* doc/bison.texi (C++ Parser Interface): Document before semantic_type
and location_type.
diff --git a/doc/bison.texi b/doc/bison.texi
index 8f11640a..344b467f 100644
--- a/doc/bison.texi
+++ b/doc/bison.texi
@@ -339,9 +339,9 @@ Parsers Written In Other Languages
C++ Parsers
* C++ Bison Interface:: Asking for C++ parser generation
+* C++ Parser Interface:: Instantiating and running the parser
* C++ Semantic Values:: %union vs. C++
* C++ Location Values:: The position and location classes
-* C++ Parser Interface:: Instantiating and running the parser
* C++ Scanner Interface:: Exchanges between yylex and parse
* A Complete C++ Example:: Demonstrating their use
@@ -10603,9 +10603,9 @@ int yyparse (void);
@menu
* C++ Bison Interface:: Asking for C++ parser generation
+* C++ Parser Interface:: Instantiating and running the parser
* C++ Semantic Values:: %union vs. C++
* C++ Location Values:: The position and location classes
-* C++ Parser Interface:: Instantiating and running the parser
* C++ Scanner Interface:: Exchanges between yylex and parse
* A Complete C++ Example:: Demonstrating their use
@end menu
@@ -10651,6 +10651,89 @@ newer.
All these files are documented using Doxygen; run @command{doxygen} for a
complete and accurate documentation.
address@hidden C++ Parser Interface
address@hidden C++ Parser Interface
address@hidden - define parser_class_name
address@hidden - Ctor
address@hidden - parse, error, set_debug_level, debug_level, set_debug_stream,
address@hidden debug_stream.
address@hidden - Reporting errors
+
+The output files @address@hidden and @address@hidden declare
+and define the parser class in the namespace @code{yy}. The class name
+defaults to @code{parser}, but may be changed using @samp{%define
+parser_class_name @address@hidden@}}. The interface of this class is detailed
+below. It can be extended using the @code{%parse-param} feature: its
+semantics is slightly changed since it describes an additional member of the
+parser class, and an additional argument for its constructor.
+
address@hidden {Type} {parser} {semantic_type}
address@hidden {Type} {parser} {location_type}
+The types for semantic values and locations (if enabled).
address@hidden defcv
+
address@hidden {Type} {parser} {token}
+A structure that contains (only) the @code{yytokentype} enumeration, which
+defines the tokens. To refer to the token @code{FOO},
+use @code{yy::parser::token::FOO}. The scanner can use
address@hidden yy::parser::token token;} to ``import'' the token enumeration
+(@pxref{Calc++ Scanner}).
address@hidden defcv
+
address@hidden {Type} {parser} {syntax_error}
+This class derives from @code{std::runtime_error}. Throw instances of it
+from the scanner or from the actions to raise parse errors. This is
+equivalent with first invoking @code{error} to report the location and
+message of the syntax error, and then to invoke @code{YYERROR} to enter the
+error-recovery mode. But contrary to @code{YYERROR} which can only be
+invoked from user actions (i.e., written in the action itself), the
+exception can be thrown from function invoked from the user action.
address@hidden defcv
+
address@hidden {Constructor} {parser} {} parser ()
address@hidden {Constructor} {parser} {} parser (@var{type1} @var{arg1}, ...)
+Build a new parser object. There are no arguments, unless
address@hidden @address@hidden @address@hidden was used.
address@hidden deftypeop
+
address@hidden {Constructor} {syntax_error} {} syntax_error (const
location_type& @var{l}, const std::string& @var{m})
address@hidden {Constructor} {syntax_error} {} syntax_error (const
std::string& @var{m})
+Instantiate a syntax-error exception.
address@hidden deftypeop
+
address@hidden {parser} {int} parse ()
+Run the syntactic analysis, and return 0 on success, 1 otherwise.
+
address@hidden exceptions
+The whole function is wrapped in a @code{try}/@code{catch} block, so that
+when an exception is thrown, the @code{%destructor}s are called to release
+the lookahead symbol, and the symbols pushed on the stack.
+
+Exception related code in the generated parser is protected by CPP guards
+(@code{#if}) and disabled when exceptions are not supported (i.e., passing
address@hidden to the C++ compiler).
address@hidden deftypemethod
+
address@hidden {parser} {std::ostream&} debug_stream ()
address@hidden {parser} {void} set_debug_stream (std::ostream& @var{o})
+Get or set the stream used for tracing the parsing. It defaults to
address@hidden::cerr}.
address@hidden deftypemethod
+
address@hidden {parser} {debug_level_type} debug_level ()
address@hidden {parser} {void} set_debug_level (debug_level @var{l})
+Get or set the tracing level. Currently its value is either 0, no trace,
+or nonzero, full tracing.
address@hidden deftypemethod
+
address@hidden {parser} {void} error (const location_type& @var{l}, const
std::string& @var{m})
address@hidden {parser} {void} error (const std::string& @var{m})
+The definition for this member function must be supplied by the user: the
+parser uses it to report a parser error occurring at @var{l}, described by
address@hidden If location tracking is not enabled, the second signature is
used.
address@hidden deftypemethod
+
+
@node C++ Semantic Values
@subsection C++ Semantic Values
@c - No objects in unions
@@ -11021,89 +11104,6 @@ files, reused by other parsers as follows:
@end example
address@hidden C++ Parser Interface
address@hidden C++ Parser Interface
address@hidden - define parser_class_name
address@hidden - Ctor
address@hidden - parse, error, set_debug_level, debug_level, set_debug_stream,
address@hidden debug_stream.
address@hidden - Reporting errors
-
-The output files @address@hidden and @address@hidden declare
-and define the parser class in the namespace @code{yy}. The class name
-defaults to @code{parser}, but may be changed using @samp{%define
-parser_class_name @address@hidden@}}. The interface of this class is detailed
-below. It can be extended using the @code{%parse-param} feature: its
-semantics is slightly changed since it describes an additional member of the
-parser class, and an additional argument for its constructor.
-
address@hidden {Type} {parser} {semantic_type}
address@hidden {Type} {parser} {location_type}
-The types for semantic values and locations (if enabled).
address@hidden defcv
-
address@hidden {Type} {parser} {token}
-A structure that contains (only) the @code{yytokentype} enumeration, which
-defines the tokens. To refer to the token @code{FOO},
-use @code{yy::parser::token::FOO}. The scanner can use
address@hidden yy::parser::token token;} to ``import'' the token enumeration
-(@pxref{Calc++ Scanner}).
address@hidden defcv
-
address@hidden {Type} {parser} {syntax_error}
-This class derives from @code{std::runtime_error}. Throw instances of it
-from the scanner or from the actions to raise parse errors. This is
-equivalent with first invoking @code{error} to report the location and
-message of the syntax error, and then to invoke @code{YYERROR} to enter the
-error-recovery mode. But contrary to @code{YYERROR} which can only be
-invoked from user actions (i.e., written in the action itself), the
-exception can be thrown from function invoked from the user action.
address@hidden defcv
-
address@hidden {Constructor} {parser} {} parser ()
address@hidden {Constructor} {parser} {} parser (@var{type1} @var{arg1}, ...)
-Build a new parser object. There are no arguments, unless
address@hidden @address@hidden @address@hidden was used.
address@hidden deftypeop
-
address@hidden {Constructor} {syntax_error} {} syntax_error (const
location_type& @var{l}, const std::string& @var{m})
address@hidden {Constructor} {syntax_error} {} syntax_error (const
std::string& @var{m})
-Instantiate a syntax-error exception.
address@hidden deftypeop
-
address@hidden {parser} {int} parse ()
-Run the syntactic analysis, and return 0 on success, 1 otherwise.
-
address@hidden exceptions
-The whole function is wrapped in a @code{try}/@code{catch} block, so that
-when an exception is thrown, the @code{%destructor}s are called to release
-the lookahead symbol, and the symbols pushed on the stack.
-
-Exception related code in the generated parser is protected by CPP guards
-(@code{#if}) and disabled when exceptions are not supported (i.e., passing
address@hidden to the C++ compiler).
address@hidden deftypemethod
-
address@hidden {parser} {std::ostream&} debug_stream ()
address@hidden {parser} {void} set_debug_stream (std::ostream& @var{o})
-Get or set the stream used for tracing the parsing. It defaults to
address@hidden::cerr}.
address@hidden deftypemethod
-
address@hidden {parser} {debug_level_type} debug_level ()
address@hidden {parser} {void} set_debug_level (debug_level @var{l})
-Get or set the tracing level. Currently its value is either 0, no trace,
-or nonzero, full tracing.
address@hidden deftypemethod
-
address@hidden {parser} {void} error (const location_type& @var{l}, const
std::string& @var{m})
address@hidden {parser} {void} error (const std::string& @var{m})
-The definition for this member function must be supplied by the user: the
-parser uses it to report a parser error occurring at @var{l}, described by
address@hidden If location tracking is not enabled, the second signature is
used.
address@hidden deftypemethod
-
-
@node C++ Scanner Interface
@subsection C++ Scanner Interface
@c - prefix for yylex.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- doc: reorder C++ sections,
Akim Demaille <=