A simple JSON parser application to demonstrate the Lexical and Syntax analysis stages of compilers
If you have Go installed and set up:
Run:
go install
Usage:
json-parser <filename> [flags]
For a list of available flags and examples, run:
json-parser --help
If you don't have Go installed:
Usage:
json-parser.exe <filename> [flags]
For a list of available options, run:
json-parser.exe --help
NOTE:
The output 'token' type from the lexer (when the -l flag is passed) consists of two fields - the token value(the actual token) and its position in the JSON string.
Two test JSON files exist in the directory. You can add any JSON file as you see fit.
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 3 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/>.