Skip to content

Releases: IrisShaders/glsl-transformer

v1.0.0-pre6.1 - Added replaceAllExpressionsConcurrent to Root

22 Jul 14:17
6ca362e
Compare
Choose a tag to compare
  • Added replaceAllExpressionsConcurrent to Root as a static method for concurrently accessible lists of nodes

Full Changelog: v1.0.0-pre6...v1.0.0-pre6.1

v1.0.0-pre6 - Advanced Tree Pattern Matching and Renaming Improvements

22 Jul 14:11
4bfe540
Compare
Choose a tag to compare
  • Fixes and improvements for renameAll
  • Added additional renaming and replacing methods to Root (all such methods are now here)
  • Add inject nodes with multiple members
  • Refactor the parsing methods to be more useful
  • Remove some unchecked casts in favor of Class.cast
  • Fix getNumber on LiteralExpression
  • Added advanced pattern matching to Matcher
  • There are now data (string) wildcards and node wildcards that can have varying predicates and behaviors
  • Rename data visiting method in void visitor

Full Changelog: v1.0.0-pre5...v1.0.0-pre6

v1.0.0-pre5 - Tree Pattern Matching

21 Jul 02:33
e086cc2
Compare
Choose a tag to compare
Pre-release
  • Added Matcher that can match AST trees against a given pattern. (with tests)
  • Added utility methods to LiteralExpression
  • Refactored some code to use instanceof pattern matching where possible
  • Make implementation of ContextTracker optional for visitor implementations
  • Added visitData to ASTVisitor and implemented it in all visitation methods. This method is called with all non-ASTNodes found in the tree.

Full Changelog: v1.0.0-pre4...v1.0.0-pre5

v1.0.0-pre4 - Index Refactor and New Utility Methods

20 Jul 03:46
9f15a13
Compare
Choose a tag to compare
  • Bugfix: Changing the name of an identifier updates this in the identifier index
  • Added parseAndInjectNode to parse an external declaration directly when inserting it
  • Made getAncestor more specifically typed
  • Refactored the identifier indexes to also have methods that return streams of identifiers and not just streams of sets of identifiers
  • Added stream-based utility method getStream for querying
  • Added ASTTransformer constructors that accept the expanded transformation formats
  • Added utility methods for parsing expressions, statements and external declarations to the ASTTransformer

Meta

  • Tests are only run sequentially on GitHub Actions

Full Changelog: v1.0.0-pre3...v1.0.0-pre4

v1.0.0-pre3 - Refactor to Registration and Indexing

19 Jul 23:06
7382c70
Compare
Choose a tag to compare
  • Improve registration in ChildNodeList
  • Use manual unregistration instead of unnecessary automatic registration
  • Added many utility methods to ASTNode for parent traversal and node management, such as swap
  • Refactor ProxyArrayList to also notify on element removals and make it more efficient with an element set
  • Improve trie types with DuplicatorTrie base class
  • Added PrefixSuffixTrie that supports suffix queries by storing a reversed instance of the word
  • Added additional convenience methods to indexes
  • Added some javadoc, not complete yet though
  • Added tests for transformation and fixed bugs with root handling
  • Enabled multiple AST builds at the same time by using a stack of currently active build roots

Full Changelog: v1.0.0-pre2...v1.0.0-pre3

v1.0.0-pre2 - Job Parameters for ASTTransformer and Node Removal Fix

16 Jul 00:19
ae85335
Compare
Choose a tag to compare
  • Added job parameter support to ASTTransformer
  • Fixed bug where nodes removed from node lists would not be unregistered from the root
  • Added tests for both of these items
  • Fixed the formatting in build.gradle again

Please report any issues or desired features!

Full Changelog: v1.0.0-pre1...v1.0.0-pre2

v1.0.0-pre1 - Full AST Support and Major Structure Changes

15 Jul 22:22
be3aeca
Compare
Choose a tag to compare

Changes:

  • Clarified token names in GLSL lexer grammar
  • Refactored GLSL parser grammar to have less redundant rules, less unnecessary rule types and fixed issues with parsing. This changes the grammar somewhat but also makes it easier to build the AST out of.
  • Removed samplerExternalOES
  • Split the project into general packages as well as the two packages .cst and .ast for the two mostly separate transformation systems
  • Moved most classes into .cst (except for the ones mentioned below)
  • Moved previous .ast package to .cst.node and extracted some of its contents to be used in both systems
  • Moved some parts of the CST infrastructure into general packages
  • Moved the job parameter handling into its own package
  • Changed InjectionPoint's members and renamed it to CSTInjectionPoint
  • Added a separate ASTInjectionPoint in .ast.transform
  • Added full AST infrastructure for building, traversal, transformation and printing in .ast using ASTBuilder, ASTVisitor, ASTListener, ASTWalker, ASTTransformer and ASTPrinter amongst others
  • Removed IntStream based transformation methods since they were never used and caused unnecessary indirection
  • The new AST transformer has only one "transformation" at a time which can contain any transformation code acting on the current translation unit (the root node).
  • Added the Root system that tracks any node removals and additions from the entire AST it is referenced by.
  • Added NodeIndex and IdentifierIndex that allow fast queries for specific types of nodes and identifiers (or their prefixes) without traversing the AST manually. These indexes are maintained automatically and are built using hash maps in the case of NodeIndex and a PATRICIA trie in the case of IdentifierIndex
  • Added vendored Trie code from Apache Collections.
  • Added PermutermTrie for use in the identifier index also allows for queries other than just prefix queries on identifiers (such as infix, suffix+prefix, suffix)
  • Added ASTPrinter and its sub classes SimpleASTPrinter, IndentingASTPrinter and CompactASTPrinter that convert the tokens emitted while walking the AST into slightly different string representations with regards to cosmetic whitespace
  • Added ProxyArrayList and related classes that are used to track node additions. Node removals are handled through parent references being changed which notifies the root of both parents.
  • Added a sub class of ASTNode for each type of node in the AST tree. Each of these nodes tracks its members and can be modified directly.
  • Added special walk classes ASTListenerVisitor and VoidVisitor
  • Added tests for ASTTransformer, integration tests for the printer, limited tests for some other things

Known issues:

  • Removal of nodes from lists is broken (fixing in next release)
  • There is no support for job parameters in ASTTransformer currently. They can be emulated by passing a class method as a transformation. (fixing in next release)
  • Javadoc is missing for most of the AST node and other new AST (and also some old) classes. This will be added as the API becomes more stable and issues are resolved

Meta:

  • This is the first pre-release of the first major version. Fixes to issues that need breaking changes will be done in a testing period (in which I will attempt to implement some of Iris' patching mechanisms using the new system) and then an actual major release will happen.
  • Upgrading from <1.0.0: Since virtually all package locations changed, you will have to re-identify where the classes you're using are. Your IDE can probably help by automatically importing all necessary classes. It is recommended to switch to use the new AST system for the reasons mentioned above. This will require re-writing all transformations but should result in more succinct transformation code and less boilerplate.
  • Please report any issues with the new and old systems! Please also report any standard functionality you would like to see in ASTNode and it's sub classes.
  • The readme was updated to reflect the existence of the new AST features and the fact that we are close to a full major-version release
  • Added a small graphic to /docs that roughly explains what glsl-transformer does
  • Moved development notes to their own file

Full Changelog: v0.27.0...v1.0.0-pre1

v0.27.0 - Fast parsing with SLL mode and improved comment parsing

13 Jun 00:40
97fff34
Compare
Choose a tag to compare
  • Added option for SLL only, LL only and SLL with a fallback of LL parsing to TransformationManager for much faster parsing
  • Refactored lexer grammar to parse line and block comments more precisely
  • Fixed issues with comments not being parsed in # and preprocessor modes (There is an open issue #17)
  • Added performance tests
  • Improved test base classes

Full Changelog: v0.26.0...v0.27.0

v0.26.0 - Tree Walk Limiting Methods and WrapIdentifier Activation Fix

10 Jun 21:56
5005fd5
Compare
Choose a tag to compare
  • Fixed activation not working for WrapIdentifier and added a test to confirm this
  • Added methods to TransformationPhase for setting a maximum walk depth after which it automatically signals isDeepEnough to the tree walker
  • Added methods to TransformationPhase for setting a set of rule classes in which the walker should walk deeper (instead of signaling isDeepEnough when the rule is not in the set of specified classes)
  • Refactored DynamicParseTreeWalker to keep track of the current walk depth and removed the default instance in favor of a static method
  • Tests for the two newly added features

Meta:

  • Updated some parts of the readme
  • The changes to the lexer grammar are just formatting

Full Changelog: v0.25.2...v0.26.0

v0.25.2 - Return type passthrough

28 May 14:26
2ebc677
Compare
Choose a tag to compare
Pre-release
  • Made return types of activation method on WrapIdentifier and SearchTerminals return each class' type instead of a more generic one
  • Added generic type passthrough to all single-argument Transformation graph-building methods

Full Changelog: v0.25.1...v0.25.2