huevo 1.0.3-DEV huevo: ^1.0.3-DEV copied to clipboard
A basic compiler infrastructure for Learning how to create a compile without any compiler's compiler
What it is #
A basic compiler infrastructure for Learning how to create a compile without any compiler's compiler
Features and bugs #
- a parser combinator library for parsing text
- a set of AST nodes that can represent basic arithmetic operations and boolean operations
- a machine code generator for WebAssembly
Please file feature requests and bugs at the tracker.
Usage #
A simple parser combinator example:
import 'package:huevo/huevo.dart';
var inputSource = InputSource('This is A Parser Combinator'.split(''));
var whiteSpace = Parser.fromElement(' ');
var keywordThis = StringParser('This');
var keywordis = StringParser('is');
var keywordA = StringParser('A');
var keywordParser = StringParser('Parser');
var keywordCombinator = StringParser('Combinator');
var sentanceParser = Parser.join(
[keywordThis, keywordis, keywordA, keywordParser, keywordCombinator],
whiteSpace).end();
var result = sentanceParser.parse(inputSource);
print(result);