Open astares opened 2 years ago
Look: That cleanup had already been stated as a TODO in the class comment of RBNode which reflects the superclass for all classes represening AST Nodes (not RB nodes)
Also a renaming of classes like RBParser into ASTParser would give a proper and more intention revealing name. At the moment the class comment says: "RBParser takes a source code string and generates an AST for it". We do not parse an "RB" - we parse source code and create an AST. So the name is somehow misleading.
A possible way to do such a cleanup could be (if we have a class RBxxxx):
I agree :) Now we should plan it for P11. Or we can do it by having RB* as subclasses of their AST counterparts for now
RBSimpleFormatter -> ASTSimpleFormatter
RBParseTreeRule -> ASTParseTreeRule RBReplaceRule -> ASTReplaceRule RBBlockReplaceRule -> ASTBlockReplaceRule RBStringReplaceRule -> ASTStringReplaceRule RBSearchRule -> ASTSearchRule RBParseTreeSearcher -> RBParseTreeSearcher RBParseTreeRewriter -> ASTParseTreeRewriter
RBNode -> ASTNode RBProgramNode -> ASTProgramNode RBComment -> ASTComment RBMethodNode -> ASTMethodNode RBPragmaNode -> ASTPragmaNode RBReturnNode -> ASTReturnNode RBSequenceNode -> ASTSequenceNode RBValueNode -> ASTValueNode RBArrayNode -> ASTArrayNode RBAssignmentNode -> ASTAssignmentNode RBBlockNode -> ASTBlockNode RBCascadeNode -> ASTCascadeNode RBLiteralNode -> ASTLiteralNode RBLiteralArrayNode -> ASTLiteralArrayNode RBLiteralValueNode -> ASTLiteralValueNode RBMessageNode -> ASTMessageNode RBSelectorNode -> ASTSelectorNode RBVariableNode -> ASTVariableNode RBStringReplacement -> ASTStringReplacement
RBParseErrorNode -> ASTParseErrorNode RBEnglobingErrorNode -> ASTEnglobingErrorNode RBArrayErrorNode -> ASTArrayErrorNode RBBlockErrorNode -> ASTBlockErrorNode RBInvalidCascadeErrorNode -> ASTInvalidCascadeErrorNode RBLiteralArrayErrorNode -> ASTLiteralArrayErrorNode RBLiteralByteArrayErrorNode -> ASTLiteralByteArrayErrorNode RBMissingOpenerErrorNode -> ASTMissingOpenerErrorNode RBParenthesesErrorNode -> ASTParenthesesErrorNode RBPragmaErrorNode -> ASTPragmaErrorNode RBTemporariesErrorNode -> ASTTemporariesErrorNode RBUnfinishedStatementErrorNode -> ASTUnfinishedStatementErrorNode RBUnreachableStatementErrorNode -> ASTUnreachableStatementErrorNode
RBParser -> ASTParser RBPatternParser -> ASTPatternParser RBScanner -> ASTScanner RBPatternScanner -> ASTPatternScanner
RBPatternBlockNode -> ASTPatternBlockNode RBPatternWrapperBlockNode -> ASTPatternWrapperBlockNode RBPatternMessageNode -> ASTPatternMessageNode RBPatternMethodNode -> ASTPatternMethodNode RBPatternPragmaNode -> ASTPatternPragmaNode RBPatternVariableNode -> ASTPatternVariableNode
RBToken -> ASTToken RBAssignmentToken -> ASTAssignmentToken RBShortAssignmentToken -> ASTShortAssignmentToken RBEOFToken -> ASTEOFToken RBValueToken -> ASTValueToken RBBinarySelectorToken -> ASTBinarySelectorToken RBCommentToken -> ASTCommentToken RBErrorToken -> ASTErrorToken RBIdentifierToken -> ASTIdentifierToken RBKeywordToken -> ASTKeywordToken RBLiteralArrayToken -> ASTLiteralArrayToken RBLiteralToken -> ASTLiteralToken RBMultiKeywordLiteralToken -> ASTMultiKeywordLiteralToken RBNumberLiteralToken -> ASTNumberLiteralToken RBPatternBlockToken -> ASTPatternBlockToken RBSpecialCharacterToken -> ASTSpecialCharacterToken
RBProgramNodeVisitor -> ASTProgramNodeVisitor RBAbstractBlockVisitor -> ASTAbstractBlockVisitor RBCommentNodeVisitor -> ASTCommentNodeVisitor RBGenericNodeVisitor -> ASTGenericNodeVisitor RBParseErrorNodeVisitor -> ASTParseErrorNodeVisitor RBDumpVisitor -> ASTDumpVisitor RBReadBeforeWrittenTester -> ASTReadBeforeWrittenTester
RBSlotInitializationNode -> ASTSlotInitializationNode
RBFormatterTest -> ASTFormatterTest
RBParseTreeRewriterTest -> ASTParseTreeRewriterTest RBParseTreeSearcherTest -> ASTParseTreeSearcherTest
RBCommentTest -> ASTCommentTest RBMessageNodeTest -> ASTMessageNodeTest RBMethodNodeTest -> ASTMethodNodeTest RBParseErrorNodeTest -> ASTParseErrorNodeTest RBProgramNodeTest -> ASTProgramNodeTest RBSequenceNodeTest -> ASTSequenceNodeTest RBVariableNodeTest -> ASTVariableNodeTest
NumberParsingTest -> ASTNumberParsingTest RBParseTreeTest -> ASTParseTreeTest RBParserTest -> ASTParserTest RBErrorNodeParserTest -> ASTErrorNodeParserTest RBPatternParserTest -> ASTPatternParserTest RBScannerTest -> ASTScannerTest
RBCommentNodeVisitorTest -> ASTCommentNodeVisitorTest RBDumpVisitorTest -> ASTDumpVisitorTest RBGenericNodeVisitorTest -> ASTGenericNodeVisitorTest RBReadBeforeWrittenTesterTest -> ASTReadBeforeWrittenTesterTest
deleted unused RASTTest
TRBProgramNodeVisitor -> ASTTProgramNodeVisitor
In order to rename the classes we should keep the old names using the new deprecated aliases feature of Pharo 12.
while there is a newer issue handling this, what about to close this one?
From the historic point of view Smalltalk started I guess Smalltalk refactorings had their roots in the Refactoring Browser (RB) and can be traced back to work at UIUC (University of Illinois, Urbana-Champaign) by Don Roberts, John Brant, and Ralph Johnson
Following this history the classes like RBNode had an "RB" prefix for RefactoringBrowser.
But logically now in newer Pharo we have put them into packages for "AST" - Abstract Syntax Tree
If you think about it for a while it would be more logically to have them prefixed with "AST" instead of "RB". Yes - we know it is heritic and means effort and deprecation/transition/migration - but for Pharo we want to constantly improve, get clean and do for the better.
Additionally this would also help people who are comming from other (more mainstream) languages to find it in alignment with the AST concepts and namings there.