Skip to main content

%Compiler.Util.Visitor

Abstract parse tree node visitor.

Property Inventory

Method Inventory

Properties

property compileParameter as %CacheString [ MultiDimensional ];
Property methods: compileParameterGet(), compileParameterIsValid(), compileParameterSet()
property errorQueue as %Integer;
Property methods: errorQueueDisplayToLogical(), errorQueueGet(), errorQueueIsValid(), errorQueueLogicalToDisplay(), errorQueueNormalize(), errorQueueSet()
property flo as %Compiler.Util.Flo;
flo - the Flo instance. Generated code is placed in Flo, symbols defined there and at the end of the compilation the Flo is 'dequeued' into a code stream/array.
Property methods: floGet(), floGetSwizzled(), floIsValid(), floNewObject(), floSet()
property formalSpec as %CacheString;
formalSpec - parsed formalSpec in the form produced by serializeFormal^%occName This value is used to define formal argument symbols when initializing the visitor #; Serialized formal list is a $list() of argument serializations which is: #; $ListBuild(,,,,,,,...,,)
Property methods: formalSpecGet(), formalSpecIsValid(), formalSpecSet()
property importPackages as %CacheString;
importPackages - a comma delimited list of package names to be imported into prepared statement implementations. These imports are used to resolve unqualified SQL names.
Property methods: importPackagesGet(), importPackagesIsValid(), importPackagesSet()
property settings as %CacheString [ MultiDimensional ];
settings is the local copy of the ^%SYS("tsql") configuration options. A local copy is maintained because tsql source can alter the settings during compilation. Current settings include: CASEINSCOMPARE - case insensitive compare. On by default. QUITONERROR - exit the current procedure if an error is detected QUOTED_IDENTIFIER - Allow identifiers to be quoted. This changes the default string delimiter from " to '. TRACE - Generate a TRACE log
Property methods: settingsGet(), settingsIsValid(), settingsSet()

Methods

method %AddToSaveSet(depth As %Integer = 3, refresh As %Integer = 0, norecurseon As %String = "") as %Status
Inherited description:

This method adds the current object to the SaveSet containing objects that are part of the current %Save() for persistent classes or %GetSwizzleObject for serial classes. A queue of objects to be saved or serialized is also constructed. Only modified objects are included in the save queue. The value (OID or serial value in OID form) of each object is also placed in the SaveSet.

This method will invoke the %OnAddToSaveSet method if it is implemented. See that method for more information.

%AddToSaveSet should not ever be invoked directly except from %OnAddToSaveSet().

This method takes these parameters: depth, with these values:

1: Include this object in the SaveSet and, if it has not been serialized put it in the save queue and invoke %AddToSaveSet on any objects referenced by this object to the SaveSet with a depth of 1.
2: Include this object in the SaveSet and save queue. Also invoke %AddToSaveSet on any referenced objects in the SaveSet with a depth of 1.
3: Include this object in the SaveSet and, if modified, the save queue. Also invoke %AddToSaveSet on any referenced objects in the SaveSet with a depth of 3.
refresh, with these values:
0: Add this object to the save set only if it isn't already included.
1: Add this object to the SaveSet even if it already exists. This causes object dependencies to be rebuilt. Typically, this value is only passed by %OnAddToSaveSet when it modifies objects other than the current one.

Note: Swizzled serial objects always have an empty serial value and will always be placed in the save queue and the SaveSet. the value of depth simply gets passed on to its referenced objects.

method %BindExport(dev As %String, ByRef Seen As %String, RegisterOref As %Boolean, AllowedDepth As %Integer, AllowedCapacity As %Integer) as %Status
Inherited description: This method is used by Language Binding Engine to send the whole object and all objects it referes to to the client.
method %ConstructClone(deep As %Boolean = 0, ByRef cloned As %String, location As %String) as %RegisteredObject
Inherited description: Clone the current object to a new object. If deep is 1 then this does a deep copy which will also copy any subobjects and if deep is 0 then it will create another reference to any subobjects and increment the reference count appropriately. It returns the new cloned object.

Note that even if deep=0 when you clone a parent object in a parent child relationship or a one object of a one to many relationship then it will construct clones of all the child/many objects. This is because a child/many object can only point at a single parent and so if we did not create a clone of these then you would have a relationship with zero items in it. If you really just want to clone the object without these child/many objects then pass deep=-1 to this method.

After the clone is constructed it will call %OnConstructClone(object,deep,.cloned) on the clone if it is defined so that you can perform any additional steps e.g. taking out a lock. This works just the same way as %OnNew() does.

The object is the oref of the original object that was cloned. The cloned array is just used internally when doing a deep clone to prevent recursive loops, do not pass anything in at all for this parameter on the initial call. If you write a %OnConstructClone and from here you wish to call %ConstructClone on another object pass in the cloned array, e.g. 'Do oref.%ConstructClone(1,.cloned)' so that it can prevent recursive loops.

The location is used internally to pass the new location for stream objects.

method %DispatchMethod(methodName As %String, args...)
UNKNOWN
method %RemoveFromSaveSet() as %Status
Inherited description:

This method removes the current object from the SaveSet. If this object is also in the save queue it is removed from there as well.

abstract classmethod compile() as %Status
compile() This method instantiates the visitor and the element class (the ParseTree) and invokes the accept() method on the element class. The results are retrieved from the visitor instance and returned to the caller.
classmethod interactive(ByRef generated As %CacheString, trigger As %Boolean = 0) as %Status
interactive - read source from the principle device and pass to the compile method
classmethod parseName(pIdentifier As %String(MAXLEN=""), ByRef pToken)
parseName is a utility to parse a delimited identifier into its component tokens.
method visit(parseTree As %Compiler.Util.ParseTree, visit As %Integer, nodePtr As %Integer, parentPtr As %Integer)
visit() visit a parse tree node. This method is just a stub that could be used to perform the polymorphic dispatch based on the node type. The accept() method of the parse tree will actually dispatch based on node type.
method visitInit()
visitInit() - this is the visit initialization. Do any work in here that you would do prior to visiting any node - a v0 if you will.
method visited()
visited() This is the exit interview - the parse tree has successfully visited all nodes in the tree and is ready to finish. This is the last visit method to be called. It is a good place to put end of code generation cycle processing.

Inherited Members

Inherited Methods

FeedbackOpens in a new tab