Lexical Analysis and Parsing
Lexers and parsers work together to process structured input such as JSON, XML, or domain-specific data formats.
The lexer constructs a scanner that reads raw text and breaks it into tokens, while the parser generator produces functions that organize these tokens into a structured representation based on a formal grammar.
Together they form the foundation of a parsing library, building adaptable toolkits for reading, validating, and transforming input data across a wide range of applications.
Lexical Scanner Utility
Designed to scan formats such as JSON and XML, this tool converts raw text into a stream of meaningful tokens for higher-level parsers. It’s compatible with Flex syntax and adds extended Unicode handling and escape sequence support, making it well-suited for modern data formats and international text.
Parser Generator Utility
This tool automatically builds parsers from formal grammar specifications, converting token streams into hierarchical syntax trees for formats such as JSON and XML. Compatible with Bison syntax, it integrates seamlessly with standard lexical analyzers and supports clear, maintainable grammars for custom data or domain-specific languages.
JSON Library
Built from a formal grammar using a parser generator, this library shows how language tools can produce fast, reliable C parsers. The resulting JSON library is fully functional on its own, ideal for reading, validating, and writing structured data. Because both the grammar and implementation are open source, developers can easily extend it to support custom JSON dialects, alternative memory layouts, or specialized application needs.
XML Library
Built from a complete XML grammar and constructed with the parser generator, this library demonstrates how formal language tools can handle the full complexity of hierarchical markup. The resulting C library provides a compact, standards-compliant foundation for reading, validating, and generating XML documents. Because both the grammar and implementation are open source, developers can adapt it for custom document models, optimized data handling, or integration into larger parsing frameworks.