source_parser 1.0.2 source_parser: ^1.0.2 copied to clipboard
A project for parsing existing Dart code. You can then modify this parsed structure to modify any Dart source code.
source_parser #
This is an API designed to parse dart code and generate an intuitive tree for editing dart source code directly.
It will open a text file (typically a .dart
file) and parse it according to the dart grammar (v2.2).
NOTE: The format the parser outputs is syntactically the same as as any code parsed, but it will almost certaintly change the format. It is not recommended to use this this parser to overwrite any files you may have written by hand.
Getting Started #
The project is written in Dart, and can be imported as a standard Dart library.
Thus, simply add it to your pubspec.yaml
like so:
dependencies:
source_parser: ^1.0.1
Then import it into whatever code you are using by importing:
import 'package:source_parser/source_parser.dart';
Prerequisites #
The only prerequisite should be Dart version >=2.2.0
License #
This project is licensed under the BSD 3-Clause "New" or "Revised" License - see the LICENSE.md file for details