Package sc.lang
Interface ILanguageModel
-
- All Superinterfaces:
IFileProcessorResult
public interface ILanguageModel extends IFileProcessorResult
Top level model object returned by parsing a language file whose semantic value returns this type (e.g. JavaModel)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
ILanguageModel.RuntimeType
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
flushTypeCache()
java.util.Map<java.lang.String,TypeDeclaration>
getDefinedTypes()
EditorContext
getEditorContext()
java.util.List<ImportDeclaration>
getImports()
long
getLastAccessTime()
Layer
getLayer()
Returns the layer which defined this particular modelLayeredSystem
getLayeredSystem()
TypeDeclaration
getLayerTypeDeclaration()
Returns the type declaration for this model for this layerjava.lang.Object
getModelType()
Same as getModelTypeDeclaration but if you have a template where the root type is a compiled class this method returns the classTypeDeclaration
getModelTypeDeclaration()
Returns the main type declaration for the model - the one with the same name as the fileILanguageModel
getModifiedModel()
int
getNodeCount()
java.lang.String
getPackagePrefix()
IParseNode
getParseNode()
boolean
getPrependPackage()
java.lang.String
getRelDirPath()
SrcEntry
getSrcFile()
java.util.List<SrcEntry>
getSrcFiles()
TypeDeclaration
getUnresolvedModelTypeDeclaration()
Returns the type declaration for this model for this layerjava.lang.Object
getUserData()
boolean
isAdded()
boolean
isInitialized()
boolean
isReplacedModel()
boolean
isStarted()
boolean
isUnsavedModel()
void
markAsTemporary()
void
refreshBoundTypes(int flags)
void
reinitialize()
Called when dependent files for this type have changed and this type needs to re-evaluate itself from it's original AST.ILanguageModel
resolveModel()
boolean
restoreParseNode()
Models can be parsed once and then serialized and de-serialized much faster.boolean
sameModel(ILanguageModel other)
An optimization - returns true if the other is the exact same model, Returns false if you are not sure.void
saveModel()
void
setAdded(boolean added)
void
setComputedPackagePrefix(java.lang.String pref)
void
setDisableTypeErrors(boolean te)
void
setLastAccessTime(long time)
void
setLastModifiedTime(long time)
void
setLayer(Layer l)
void
setLayeredSystem(LayeredSystem system)
void
stop()
Called when this model nees to be regenerated-
Methods inherited from interface sc.layer.IFileProcessorResult
addSrcFile, getDependentFiles, getLastModifiedTime, getPostBuildFileId, getProcessedFileId, getProcessedFiles, hasErrors, needsCompile, needsPostBuild, postBuild, setHasErrors
-
-
-
-
Method Detail
-
getSrcFiles
java.util.List<SrcEntry> getSrcFiles()
-
getSrcFile
SrcEntry getSrcFile()
- Specified by:
getSrcFile
in interfaceIFileProcessorResult
-
setLayeredSystem
void setLayeredSystem(LayeredSystem system)
-
getLayeredSystem
LayeredSystem getLayeredSystem()
-
getLayer
Layer getLayer()
Returns the layer which defined this particular model
-
setLayer
void setLayer(Layer l)
-
getPackagePrefix
java.lang.String getPackagePrefix()
-
getModelTypeDeclaration
TypeDeclaration getModelTypeDeclaration()
Returns the main type declaration for the model - the one with the same name as the file
-
getModelType
java.lang.Object getModelType()
Same as getModelTypeDeclaration but if you have a template where the root type is a compiled class this method returns the class
-
getLayerTypeDeclaration
TypeDeclaration getLayerTypeDeclaration()
Returns the type declaration for this model for this layer
-
getUnresolvedModelTypeDeclaration
TypeDeclaration getUnresolvedModelTypeDeclaration()
Returns the type declaration for this model for this layer
-
getDefinedTypes
java.util.Map<java.lang.String,TypeDeclaration> getDefinedTypes()
-
getImports
java.util.List<ImportDeclaration> getImports()
-
setComputedPackagePrefix
void setComputedPackagePrefix(java.lang.String pref)
-
setDisableTypeErrors
void setDisableTypeErrors(boolean te)
-
getRelDirPath
java.lang.String getRelDirPath()
-
getParseNode
IParseNode getParseNode()
-
saveModel
void saveModel()
-
setLastModifiedTime
void setLastModifiedTime(long time)
-
setLastAccessTime
void setLastAccessTime(long time)
-
getLastAccessTime
long getLastAccessTime()
-
getModifiedModel
ILanguageModel getModifiedModel()
-
resolveModel
ILanguageModel resolveModel()
-
getPrependPackage
boolean getPrependPackage()
-
reinitialize
void reinitialize()
Called when dependent files for this type have changed and this type needs to re-evaluate itself from it's original AST. It might happen if the subclass depends on the code in the base class or if the subclass failed to compile and we need to retry things again.
-
setAdded
void setAdded(boolean added)
-
isAdded
boolean isAdded()
-
markAsTemporary
void markAsTemporary()
-
getUserData
java.lang.Object getUserData()
-
sameModel
boolean sameModel(ILanguageModel other)
An optimization - returns true if the other is the exact same model, Returns false if you are not sure.
-
refreshBoundTypes
void refreshBoundTypes(int flags)
-
flushTypeCache
void flushTypeCache()
-
isInitialized
boolean isInitialized()
-
isStarted
boolean isStarted()
-
stop
void stop()
Called when this model nees to be regenerated
-
isUnsavedModel
boolean isUnsavedModel()
-
getEditorContext
EditorContext getEditorContext()
-
isReplacedModel
boolean isReplacedModel()
-
getNodeCount
int getNodeCount()
-
restoreParseNode
boolean restoreParseNode()
Models can be parsed once and then serialized and de-serialized much faster. When a model is deserialized, we can restore the parse nodes using this operation. When the model is cached, we can either cache the parse-node tree as well or not. Either way, it's faster to restore the parse-node tree with the existing model than to parse it again from scratch.
-
-