Simple example of setting up a C++ parser.
More...
#include "main.h"
Go to the source code of this file.
Simple example of setting up a C++ parser.
- Instantiation of the parser.
- Initilizing rule and UDT syntax and semantic callback functions.
- Tracing the parser.
- Statistics gathering and display.
- Displaying the parser state.
- Create, display and translate the AST.
The grammar file for this test has been generated with the parser generator command:
apg /in:CppDemo.bnf /C++:CppDemo /dwarnings /dtypes
Definition in file main.cpp.
◆ main()
The main function. Takes no command line arguments.
Definition at line 42 of file main.cpp.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see
http://www.gnu.org/licenses/licenses.html
or write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.