%parse-param @{ char const *file_name @};
%initial-action
@{
- @@$.begin.file_name = @@$.end.file_name = file_name;
- @@$.begin.file_name = @@$.end.file_name = file_name;
+ @@$.begin.filename = @@$.end.filename = file_name;
@};
@end example
The value returned by @code{yyparse} is 0 if parsing was successful (return
is due to end-of-input).
-The value is 1 if parsing failed (return is due to a syntax error).
+The value is 1 if parsing failed because of invalid input, i.e., input
+that contains a syntax error or that causes @code{YYABORT} to be
+invoked.
+
+The value is 2 if parsing failed due to memory exhaustion.
@end deftypefun
In an action, you can cause immediate return from @code{yyparse} by using
@c - %locations
@c - class Position
@c - class Location
-@c - %define "file_name_type" "const symbol::Symbol"
+@c - %define "filename_type" "const symbol::Symbol"
When the directive @code{%locations} is used, the C++ parser supports
location tracking, see @ref{Locations, , Locations Overview}. Two
The name of the file. It will always be handled as a pointer, the
parser will never duplicate nor deallocate it. As an experimental
feature you may change it to @samp{@var{type}*} using @samp{%define
-"file_name_type" "@var{type}"}.
+"filename_type" "@var{type}"}.
@end deftypemethod
@deftypemethod {position} {unsigned int} line
%initial-action
@{
// Initialize the initial location.
- @@$.begin.file_name = @@$.end.file_name = &driver.file;
+ @@$.begin.filename = @@$.end.filename = &driver.file;
@};
@end example