peg 0.0.51 peg: ^0.0.51 copied to clipboard
PEG (Parsing expression grammar) parsers generator.
Use this package as a library
Depend on it
Run this command:
With Dart:
$ dart pub add peg
This will add a line like this to your package's pubspec.yaml (and run an implicit dart pub get
):
dependencies:
peg: ^0.0.51
Alternatively, your editor might support dart pub get
. Check the docs for your editor to learn more.
Import it
Now in your Dart code, you can use:
import 'package:peg/automaton/automaton.dart';
import 'package:peg/automaton/src/automaton/automaton.dart';
import 'package:peg/automaton/src/automaton/automaton_builder.dart';
import 'package:peg/automaton/src/automaton/expression_state.dart';
import 'package:peg/automaton/src/automaton/expression_states.dart';
import 'package:peg/case_generator/case_generator.dart';
import 'package:peg/case_generator/src/case_generator/case_generator.dart';
import 'package:peg/frontend_analyzer/frontend_analyzer.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/expected_lexemes_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/expression_able_not_consume_input_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/expression_callers_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/expression_hierarchy_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/expression_length_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/expression_level_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/expression_matches_eof_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/expression_ownership_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/expression_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/expression_with_actions_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/frontend_analyzer.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/invocations_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/left_expressions_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/optional_expressions_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/production_rule_kinds_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/repetition_expressions_resolver .dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/right_expressions_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/rule_expression_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/start_characters_resolver.dart';
import 'package:peg/frontend_analyzer/src/frontend_analyzer/starting_rules_finder.dart';
import 'package:peg/general_parser/expression_generators.dart';
import 'package:peg/general_parser/parser_class_generator.dart';
import 'package:peg/general_parser/parser_generator.dart';
import 'package:peg/general_parser/production_rule_generator.dart';
import 'package:peg/general_parser/src/expression_generators/and_predicate_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/any_character_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/character_class_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/list_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/literal_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/not_predicate_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/one_or_more_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/optional_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/ordered_choice_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/rule_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/sequence_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/unary_expression_generator.dart';
import 'package:peg/general_parser/src/expression_generators/zero_or_more_expression_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/method_get_state_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/method_match_any_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/method_match_char_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/method_match_mapping_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/method_match_range_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/method_match_ranges_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/method_match_string_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/method_next_char_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/method_trace_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/method_unmap_generator.dart';
import 'package:peg/general_parser/src/parser_class_generator/parser_class_generator.dart';
import 'package:peg/general_parser/src/parser_generator/parser_generator.dart';
import 'package:peg/general_parser/src/production_rule_generator/production_rule_generator.dart';
import 'package:peg/generators/generators.dart';
import 'package:peg/generators/src/generators/class_generator.dart';
import 'package:peg/generators/src/generators/declaration_generator.dart';
import 'package:peg/generators/src/generators/generator.dart';
import 'package:peg/generators/src/generators/template_generator.dart';
import 'package:peg/generators/src/generators/variable_generator.dart';
import 'package:peg/grammar/expression_visitors.dart';
import 'package:peg/grammar/expressions.dart';
import 'package:peg/grammar/grammar.dart';
import 'package:peg/grammar/grammar_analyzer.dart';
import 'package:peg/grammar/grammar_reporter.dart';
import 'package:peg/grammar/production_rule.dart';
import 'package:peg/grammar/src/expressions/and_predicate_expression.dart';
import 'package:peg/grammar/src/expressions/any_character_expression.dart';
import 'package:peg/grammar/src/expressions/character_class_expression.dart';
import 'package:peg/grammar/src/expressions/expression.dart';
import 'package:peg/grammar/src/expressions/expression_types.dart';
import 'package:peg/grammar/src/expressions/list_expression.dart';
import 'package:peg/grammar/src/expressions/literal_expression.dart';
import 'package:peg/grammar/src/expressions/not_predicate_expression.dart';
import 'package:peg/grammar/src/expressions/one_or_more_expression.dart';
import 'package:peg/grammar/src/expressions/optional_expression.dart';
import 'package:peg/grammar/src/expressions/ordered_choice_expression.dart';
import 'package:peg/grammar/src/expressions/prefix_expression.dart';
import 'package:peg/grammar/src/expressions/rule_expression.dart';
import 'package:peg/grammar/src/expressions/sequence_expression.dart';
import 'package:peg/grammar/src/expressions/suffix_expression.dart';
import 'package:peg/grammar/src/expressions/unary_expression.dart';
import 'package:peg/grammar/src/expressions/zero_or_more_expression.dart';
import 'package:peg/grammar/src/grammar/grammar.dart';
import 'package:peg/grammar/src/grammar/rule_expression_resolver.dart';
import 'package:peg/grammar/src/grammar_analyzer/choice_with_optional_finder.dart';
import 'package:peg/grammar/src/grammar_analyzer/duplicate_rules_finder.dart';
import 'package:peg/grammar/src/grammar_analyzer/grammar_analyzer.dart';
import 'package:peg/grammar/src/grammar_analyzer/infinite_loop_finder.dart';
import 'package:peg/grammar/src/grammar_analyzer/language_hiding_finder.dart';
import 'package:peg/grammar/src/grammar_analyzer/left_recursions_finder.dart';
import 'package:peg/grammar/src/grammar_analyzer/nonterminals_with_lexemes_finder.dart';
import 'package:peg/grammar/src/grammar_analyzer/starting_rules_finder.dart';
import 'package:peg/grammar/src/grammar_analyzer/unresolved_rules_finder.dart';
import 'package:peg/grammar/src/grammar_reporter/grammar_reporter.dart';
import 'package:peg/grammar/src/production_rule/production_rule.dart';
import 'package:peg/grammar/src/visitors/expression_visitor.dart';
import 'package:peg/grammar/src/visitors/simple_expression_visitor.dart';
import 'package:peg/grammar/src/visitors/unifying_expression_visitor.dart';
import 'package:peg/grammar_analyzer/grammar_analyzer.dart';
import 'package:peg/grammar_analyzer/src/grammar_analyzer/choice_with_optional_finder.dart';
import 'package:peg/grammar_analyzer/src/grammar_analyzer/duplicate_rules_finder.dart';
import 'package:peg/grammar_analyzer/src/grammar_analyzer/grammar_analyzer.dart';
import 'package:peg/grammar_analyzer/src/grammar_analyzer/infinite_loop_finder.dart';
import 'package:peg/grammar_analyzer/src/grammar_analyzer/left_recursions_finder.dart';
import 'package:peg/grammar_analyzer/src/grammar_analyzer/nonterminals_with_lexemes_finder.dart';
import 'package:peg/grammar_analyzer/src/grammar_analyzer/starting_rules_finder.dart';
import 'package:peg/grammar_analyzer/src/grammar_analyzer/unresolved_rules_finder.dart';
import 'package:peg/grammar_reporter/grammar_reporter.dart';
import 'package:peg/grammar_reporter/src/grammar_reporter/grammar_reporter.dart';
import 'package:peg/interpreter_parser/compiler.dart';
import 'package:peg/interpreter_parser/decoder_generators.dart';
import 'package:peg/interpreter_parser/instructions.dart';
import 'package:peg/interpreter_parser/optimizer.dart';
import 'package:peg/interpreter_parser/parser_class_generator.dart';
import 'package:peg/interpreter_parser/parser_generator.dart';
import 'package:peg/interpreter_parser/resolvers.dart';
import 'package:peg/interpreter_parser/semantic_action_generator.dart';
import 'package:peg/interpreter_parser/src/compiler/compiler.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/and_predicate_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/any_character_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/character_class_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/character_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/empty_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/literal_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/not_predicate_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/one_or_more_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/optional_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/ordered_choice_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/production_rule_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/rule_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/sequence_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/sequence_with_one_element_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/decoder_generators/zero_or_more_decoder_generator.dart';
import 'package:peg/interpreter_parser/src/instructions/and_predicate_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/any_character_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/character_class_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/character_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/empty_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/literal_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/not_predicate_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/one_or_more_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/optional_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/ordered_choice_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/production_rule_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/rule_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/sequence_element_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/sequence_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/unary_instruction.dart';
import 'package:peg/interpreter_parser/src/instructions/zero_or_more_instruction.dart';
import 'package:peg/interpreter_parser/src/optimizer/instruction_optimizer.dart';
import 'package:peg/interpreter_parser/src/optimizer/optimizer.dart';
import 'package:peg/interpreter_parser/src/optimizer/redundant_instruction_remover.dart';
import 'package:peg/interpreter_parser/src/parser_class_generator/interpreter_class_generator.dart';
import 'package:peg/interpreter_parser/src/parser_class_generator/method_decode_generator.dart';
import 'package:peg/interpreter_parser/src/parser_class_generator/method_parse_entry_generator.dart';
import 'package:peg/interpreter_parser/src/parser_class_generator/method_parse_generator.dart';
import 'package:peg/interpreter_parser/src/parser_generator/expression_converter.dart';
import 'package:peg/interpreter_parser/src/parser_generator/parser_generator.dart';
import 'package:peg/interpreter_parser/src/parser_generator/production_rule_instruction_builder.dart';
import 'package:peg/interpreter_parser/src/resolvers/production_rule_finder.dart';
import 'package:peg/interpreter_parser/src/semantic_action_generator/action_generator.dart';
import 'package:peg/interpreter_parser/src/semantic_action_generator/method_action_generator.dart';
import 'package:peg/interpreter_parser/src/semantic_action_generator/semantic_action_generator.dart';
import 'package:peg/interpreter_parser/src/visitors/instruction_cloner.dart';
import 'package:peg/interpreter_parser/src/visitors/instruction_visitor.dart';
import 'package:peg/interpreter_parser/src/visitors/simple_instruction_visitor.dart';
import 'package:peg/interpreter_parser/src/visitors/unifying_instruction_visitor.dart';
import 'package:peg/interpreter_parser/visitors.dart';
import 'package:peg/optimizer/optimizer.dart';
import 'package:peg/optimizer/src/left_recursion_remover.dart';
import 'package:peg/parser_generator/parser_class_generator.dart';
import 'package:peg/parser_generator/parser_error_class_generator.dart';
import 'package:peg/parser_generator/parser_generator.dart';
import 'package:peg/parser_generator/parser_generator_options.dart';
import 'package:peg/parser_generator/src/parser_class_generator/contructor_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/method_add_to_cache_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/method_errors_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/method_failure_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/method_flatten_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/method_get_from_cache_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/method_list_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/method_reset_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/method_text_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/method_to_code_point_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/method_to_code_points_generator.dart';
import 'package:peg/parser_generator/src/parser_class_generator/parser_class_generator.dart';
import 'package:peg/parser_generator/src/parser_error_class_generator/contructor_generator.dart';
import 'package:peg/parser_generator/src/parser_error_class_generator/operator_equals_generator.dart';
import 'package:peg/parser_generator/src/parser_error_class_generator/parser_error_class_generator.dart';
import 'package:peg/parser_generator/src/parser_generator/parser_generator.dart';
import 'package:peg/parser_generator/src/parser_generator_options/parser_generator_options.dart';
import 'package:peg/state_machine_generator/src/state_machine_generator/state_machine_generator.dart';
import 'package:peg/state_machine_generator/state_machine_generator.dart';
import 'package:peg/trace/src/trace/trace.dart';
import 'package:peg/trace/trace.dart';
import 'package:peg/utils/src/utils/utils.dart';
import 'package:peg/utils/utils.dart';