Skip to content

SmaCC: Transforming the AST #4117

Closed Answered by j-brant
joelreymont asked this question in Q&A
Discussion options

You must be logged in to vote

If I'm doing large scale changes, I use the transformation toolkit. For example, here's what I use to convert antlr grammars:

IceRepositoryCreator
	fromUrl: 'https://github.com/antlr/grammars-v4.git'
	to: './grammars-v4' asFileReference.
SmaCCTransformationToolkitModel new
	inputParserClass: Antlr4Parser;
	validationParserClass: SmaCCDefinitionParser;
	loadRewriteFile: './pharo-local/iceberg/j-brant/SmaCC/rewrites/antlr/antlr.rw';
	files: ('./grammars-v4' asFileReference allChildrenMatching: '*.g4');
	outputDirectory: '.';
	createSubdirectories: true;
	runOnServer: false

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by joelreymont
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants