forked from pegjs/pegjs
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Plugin API: Split compiler passes into stages
The compiler passes are now split into three stages: * check -- passes that check for various error conditions * transform -- passes that transform the AST (e.g. to perform optimizations) * generate -- passes that are related to code generation Splitting the passes into stages is important for plugins. For example, if a plugin wants to add a new optimization pass, it can add it at the end of the "transform" stage without any knowledge about other passes it contains. Similarly, if it wants to generate something else than the default code generator does from the AST, it can just replace all passes in the "generate" stage by its own one(s). More generally, the stages make it possible to write plugins that do not depend on names and actions of specific passes (which I consider internal and subject of change), just on the definition of stages (which I consider a public API with to which semver rules apply). Implements part of pegjsGH-106.
- Loading branch information
Showing
6 changed files
with
39 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters