|
Class: RBParser
Object
|
+--RBParser
- Package:
- stx:goodies/refactoryBrowser/parser
- Category:
- Refactory-Parser
- Version:
- rev:
1.120
date: 2024/01/22 15:09:27
- user: cg
- file: RBParser.st directory: goodies/refactoryBrowser/parser
- module: stx stc-classLibrary: parser
accessing
-
cacheRecentlyParsedMethods
-
-
cacheRecentlyParsedMethods: aBoolean
-
flush cache
Usage example(s):
self cacheRecentlyParsedMethods:true
self cacheRecentlyParsedMethods:false
|
class initialization
-
initialize
-
Try to determine which image we're running in
Usage example(s):
-
parserType
-
-
parserType: aSymbol
-
formatting
-
format: textOrStream in: aClass notifying: aRequestor contentsSymbol: aSymbol
-
Compile a parse tree from the argument, textOrStream. Answer a string containing the original code, formatted nicely. If aBoolean is true, then decorate the resulting text with color and hypertext actions
-
format: aString in: anIgnoredClass notifying: aRequester decorated: decorated
-
parsing
-
flushCachedTree: aTree
-
RecentlyParsedMethods := nil
-
flushCachedTreeFor: aString
-
-
flushCachedTrees
-
self flushCachedTrees
-
lowSpaceCleanup
-
self lowSpaceCleanup
-
parseDoItMethodBody: aString onError: aBlock
-
-
parseExpression: aString
-
-
parseExpression: aString onError: aBlockOrNil
-
-
parseExpression: aString onError: aBlock rememberNodes: rememberNodes nodeGenerationCallback: nodeGenerationCallbackOrNil
-
a more general entry which calls a hook on node generation and
remembers them optionally. Use to get the nodes before erroneous code
even if a real parse tree cannot be constructed (due to syntax errors).
Needed for the code-completion and explainers to get 'up-to-the-point' where
the cursor is, even if there is nothing valid after it
-
parseExpression: aString setup: setupBlock onError: aBlock
-
a more general entry which calls a hook on node generation and
remembers them optionally. Use to get the nodes before erroneous code
even if a real parse tree cannot be constructed (due to syntax errors).
Needed for the code-completion and explainers to get 'up-to-the-point' where
the cursor is, even if there is nothing valid after it
-
parseMethod: aString
-
-
parseMethod: aString onError: aBlock
-
-
parseMethod: aString onError: aBlock proceedAfterError: proceedAfterError
-
-
parseMethod: aString onError: aBlock proceedAfterError: proceedAfterError rememberNodes: rememberNodes
-
-
parseMethod: aString onError: aBlock rememberNodes: rememberNodes
-
a more general entry which calls a hook on node generation and
remembers them optionally. Use to get the nodes before erroneous code
even if a real parse tree cannot be constructed (due to syntax errors).
Needed for the code-completion and explainers to get 'up-to-the-point' where
the cursor is, even if there is nothing valid after it
-
parseMethod: aString onError: aBlock rememberNodes: rememberNodes nodeGenerationCallback: nodeGenerationCallbackOrNil
-
a more general entry which calls a hook on node generation and
remembers them optionally. Use to get the nodes before erroneous code
even if a real parse tree cannot be constructed (due to syntax errors).
Needed for the code-completion and explainers to get 'up-to-the-point' where
the cursor is, even if there is nothing valid after it
-
parseMethod: aString setup: setupBlock onError: aBlock
-
a more general entry which calls a hook on node generation and
remembers them optionally. Use to get the nodes before erroneous code
even if a real parse tree cannot be constructed (due to syntax errors).
Needed for the code-completion and explainers to get 'up-to-the-point' where
the cursor is, even if there is nothing valid after it
-
parseMethod: aString tryCache: tryCacheBoolean onError: aBlock
-
Transcript showCR:'hit'.
-
parseMethodPattern: aString
-
BRParser parseMethodPattern:'foo:foo1 bar:bar1 baz:baz1'
-
parseMethodWithNoComments: aString
-
-
parseMethodWithNoComments: aString onError: aBlock
-
Modified (format): / 22-01-2024 / 15:34:29 / cg
-
parseRewriteExpression: aString
-
-
parseRewriteExpression: aString keepComments: keepComments
-
-
parseRewriteExpression: aString keepComments: keepComments onError: aBlock
-
-
parseRewriteExpression: aString onError: aBlock
-
-
parseRewriteMethod: aString
-
-
parseRewriteMethod: aString onError: aBlock
-
-
parseSearchMethod: aString onError: aBlock
-
-
parseVariableNames: aString
-
RBParser parseVariableNames:'foo bar ',Character doubleQuote,'comment',Character doubleQuote,' baz'
testing
-
isIBM
-
-
isSmalltalkX
-
self isSmalltalkX
-
isSqueak
-
-
isVisualWorks
-
ST/X is visualworks alike enough to allow for this ...
accessing
-
currentMethodNode
-
only valid while within a method-parse (nil otherwise).
Useful to see what has been parsed so far,
in case of an error
(codecompletion uses this to look for
args and locals, even if the source is not syntactically correct)
-
currentScope
-
only valid while within a method-parse (nil otherwise).
Useful to see what has been parsed so far, in case of an error
(codecompletion uses this to look for variables in scope,
even if the source is not syntactically correct)
-
errorBlock: aBlock
-
-
initializeParserWith: aString type: aSymbol
-
Smalltalk dialectName = 'SmalltalkX' ifTrue:[
-
nodesSoFar
-
In case of an error, this allows for the nodes which have been collected
so far to be fetched. Useful for code completion of incomplete (erroneous) code.
-
parseDoItMethodBody: aString
-
-
parseExpression
-
-
parseMethod: aString
-
-
parseMethodWithNoComments: aString
-
Modified (format): / 22-01-2024 / 15:34:38 / cg
-
proceedAfterError: aBoolean
-
-
rememberedTokens
-
In case of an error, this allows for the tokens which have been collected
so far to be fetched. Useful for code completion of incomplete (erroneous) code.
error handling
-
errorBlock
-
-
errorPosition
-
-
parserError: aString
-
Evaluate the errorBlock. If it returns raise an error
-
parserError: msg lastNode: aNode
-
-
rememberLastNode: aNode
-
-
scannerError: aString
-
Evaluate the block. If it returns raise an error
initialization & release
-
initializeForIBM
-
-
initializeForSmalltalkX
-
-
initializeForSqueak
-
-
initializeForVisualWorks
-
-
nodeGenerationCallback: nodeGenerationCallbackOrNil
-
-
rememberNodes
-
** This is an obsolete interface - do not use it (it may vanish in future versions) **
-
rememberNodes: aBoolean
-
enable node remembering.
In case of an error, this allows for the nodes which have been collected
so far to be fetched. Useful for code completion of incomplete (erroneous) code.
-
rememberTokens: aBoolean
-
enable token remembering.
In case of an error, this allows for the tokens which have been collected
so far to be fetched. Useful for code completion of incomplete (erroneous) code.
-
saveComments: aBoolean
-
-
scanner
-
-
scanner: aScanner
-
private
-
addComments: comments afterNode: aNode
-
-
addComments: comments beforeNode: aNode
-
-
nextToken
-
-
patchLiteralMessage
-
-
patchNegativeLiteral
-
Handle the special negative number case for binary message sends.
-
step
-
private-parsing
-
parseArgs
-
currentToken isIdentifier ifTrue:[
-
parseArray
-
parse Squeak's {} construct
-
parseAssignment
-
Need one token lookahead to see if we have a ':='. This method could
make it possible to assign the literals true, false and nil.
-
parseBinaryMessage
-
-
parseBinaryMessageWith: leftNode
-
create first, so we have the node in case of an error.
-
parseBinaryPattern
-
-
parseBlock
-
node arguments do:[:eachArg | eachArg parent:self].
-
parseBlockArgsInto: blockNode
-
:
-
parseCascadeMessage
-
-
parseDoItMethodBody
-
-
parseKeywordMessage
-
comments notEmptyOrNil ifTrue:[self halt].
-
parseKeywordMessageWith: node
-
-
parseKeywordPattern
-
CG: lifted /duplicated the error check to allow for the keyword-node to
-
parseMessagePattern
-
-
parseMethod
-
comments after last argument are treated like a body comment
-
parseMethodWithNoComments
-
self addCommentsTo: methodNode.
-
parseNegatedNumber
-
create a new token out of the $- and the number
-
parseOptimizedExpression
-
-
parseParenthesizedExpression
-
-
parsePatternBlock
-
ensure that right is set, even if parse aborted due to an error
-
parsePrimitiveIdentifier
-
scanner has already advanced - comments do not belong to node
-
parsePrimitiveLiteral
-
RBParser parseExpression:' e''a {1} b { 2 }'' '
-
parsePrimitiveObject
-
-
parsePrimitiveObjectIfFail: failBlock
-
primitive c-code expressions
-
parseResourceTag
-
remembers resources in the tags instVar
-
parseSTXPrimitiveCCodeExpression
-
-
parseStatementList: tagBoolean into: sequenceNode
-
skip empty statements
-
parseStatements: tagBoolean
-
locals size > 0 ifTrue:[ self halt.
-
parseUnaryMessage
-
primary should follow
-
parseUnaryMessageWith: aNode
-
-
parseUnaryPattern
-
-
parseVariableNode
-
testing
-
atEnd
-
class == RBToken
|