public class LocalIdents extends java.lang.Object
Constructor and Description |
---|
LocalIdents(org.vishia.java2C.ClassData declaringClass)
constructs a new instance for a class level.
|
LocalIdents(LocalIdents parent,
org.vishia.java2C.ClassData declaringClassData,
boolean hasFields,
java.lang.String sPkgName)
constructs a new instance copying all parent identifier.
|
LocalIdents(LocalIdents parent,
java.lang.String sPkgName)
constructs a new instance with copy all parent identifier as base.
|
LocalIdents(java.lang.String sPkgName)
constructs a new Instance for primary types.
|
Modifier and Type | Method and Description |
---|---|
FieldData |
get(java.lang.String sIdent)
searches the infos to the given identifier.
|
java.lang.String |
getAllTypeIdents()
Returns a String with all available type idents comma separated.
|
FieldData |
getField(java.lang.String name)
Test whether the field is known and returns it data.
|
java.lang.String |
getSourceOfClassData() |
org.vishia.java2C.ClassData |
getType(java.lang.String sIdent,
LocalIdents fileLevelIdents)
searches the ClassData to the given type identifier.
|
JavaSources.ClassDataOrJavaSrcFile |
getTypeInfo(java.lang.String sIdentP,
LocalIdents fileLevelIdents)
searches the infos to the given type identifier.
|
java.util.Set<java.util.Map.Entry<java.lang.String,JavaSources.ClassDataOrJavaSrcFile>> |
getTypeSet()
Returns an iterable list with all typeIdents.
|
void |
putClassElement(java.lang.String sIdent,
FieldData identInfo)
puts a new class element (field, attribute, reference) in the container.
|
void |
putClassElement(java.lang.String sIdent,
java.lang.String sType,
org.vishia.java2C.ClassData typeClazz,
char staticMode,
char modeAccess,
java.lang.String sModifier,
int dimensionArray,
java.lang.String[] fixArraySizes,
char modeArrayElement,
org.vishia.java2C.ClassData clazz)
puts a new class element (field, attribute, reference) in the container.
|
void |
putClassType(org.vishia.java2C.ClassData typeClazz) |
void |
putClassType(java.lang.String sTypeIdent,
JavaSources.ClassDataOrJavaSrcFile typeClazz) |
void |
putClassType(java.lang.String sTypeIdent,
java.lang.String sTypeNameC,
org.vishia.java2C.ClassData typeClazz,
java.lang.String sModifier,
org.vishia.java2C.ClassData clazz)
Deprecated.
use
#putClassType(String, ClassData) |
void |
putClassTypesAll(LocalIdents parent) |
void |
putClassTypeStandard(org.vishia.java2C.ClassData typeClazz)
Puts the class into the typeIdents, with key with and without package.
|
void |
putLocalElement(java.lang.String sIdent,
FieldData identInfo)
puts a new stack-local element in the container.
|
java.lang.String |
toString() |
java.lang.String |
xxxwriteStructOwnClassFields(int recursion) |
public LocalIdents(LocalIdents parent, org.vishia.java2C.ClassData declaringClassData, boolean hasFields, java.lang.String sPkgName)
parent
- The identifier infos of the parent scope are copied,
the parent scope is not touched (changed). This parameter should be null
while the LocalIdents of a non-inner class is created because there aren't
any identifiers to copy outside of a top-level class.
It should be given, if the LocalIdents of a method or statement blocks
or of an inner class is created.declaringClassData
- All identifier infos of all super and outer classes
of this class are copied. This parameter should be null
while the LocalIdents of methods or statement blocks are created.fileLevelIdents
- LocalIdents of the package.public LocalIdents(LocalIdents parent, java.lang.String sPkgName)
parent
- The identifier infos of the parent scope is copied,
but the parent scope should be not touched (changed).public LocalIdents(java.lang.String sPkgName)
public LocalIdents(org.vishia.java2C.ClassData declaringClass)
declaringClass
- The class where the LocalIdents are assigned to.fileLevelIdents
- The LocalIdents of the package containing all package visible and commonly types.public FieldData get(java.lang.String sIdent)
sIdent
- The identifier.public org.vishia.java2C.ClassData getType(java.lang.String sIdent, LocalIdents fileLevelIdents) throws java.text.ParseException
JavaSrcTreeFile
, which isn't translated, its first pass is run now.
The first pass translates the file either, or it reads its structure (stc-)file.
JavaSrcTreeFile
nor as ClassData
,
this method returns null
.
It may be possible that the type should be exists as a unknown type, than it is created, outside of this routine
see GenerateClass#getType(org.vishia.zbnf.ZbnfParseResultItem, LocalIdents)
.
It may be possible too, that the identifier may be either a type
or an association. If it isn't found as type, it may be found as association. Therefore this routine
have to be returned null
at unknown identifiers.sIdent
- The identifier.java.lang.IllegalArgumentException
- if any problem while running first pass occurs.java.text.ParseException
public JavaSources.ClassDataOrJavaSrcFile getTypeInfo(java.lang.String sIdentP, LocalIdents fileLevelIdents)
getType(String, LocalIdents)
.
int
etc. and the java.lang
.Types.
It are referred by CRuntimeJavalikeClassData.stdTypes
.
Java2C_Main.externalTypes
.
null
at unknown identifiers.
An exception or error message mustn't create here.sIdent
- The identifier. It is possible it is a package path,
at example java.lang.Object
. The separator between package idents
can be a slash or a dot.fileLevelIdents
- Contains all types which are known as environment for translation
of this file. They are all package level types
and all types, which are known because import-statements.ClassData
for simple types, or it is an instance of JavaSrcTreeFile
.
If the file is translated already, calling JavaSources.ClassDataOrJavaSrcFile.getClassData()
supplies the ClassData, if it isn't translated yet but only known as Java-File, getClassData() returns null
.java.text.ParseException
public void putClassElement(java.lang.String sIdent, java.lang.String sType, org.vishia.java2C.ClassData typeClazz, char staticMode, char modeAccess, java.lang.String sModifier, int dimensionArray, java.lang.String[] fixArraySizes, char modeArrayElement, org.vishia.java2C.ClassData clazz)
sIdent
- The textual representation of the identifier in java code context.sType
- The associated type string if it is a field or method. null if it is a type.typeClazz
- The associated type classsModifier
- Kind of the identifier. See table in the description of the class ClassData
.clazz
- The associated class datapublic void putClassElement(java.lang.String sIdent, FieldData identInfo)
sIdent
- nameidentInfo
- all infos to the field@Deprecated public void putClassType(java.lang.String sTypeIdent, java.lang.String sTypeNameC, org.vishia.java2C.ClassData typeClazz, java.lang.String sModifier, org.vishia.java2C.ClassData clazz)
#putClassType(String, ClassData)
sTypeIdent
- The textual representation of the identifier in java code context.sTypeNameC
- The type name in C, with outerclass__sTypeIdent.typeClazz
- The associated type classsModifier
- Kind of the identifier. See table in the description of the class ClassData
.clazz
- The associated class datapublic void putClassType(java.lang.String sTypeIdent, JavaSources.ClassDataOrJavaSrcFile typeClazz)
public void putClassType(org.vishia.java2C.ClassData typeClazz)
public void putClassTypeStandard(org.vishia.java2C.ClassData typeClazz)
typeClazz
- The class.public void putClassTypesAll(LocalIdents parent)
public void putLocalElement(java.lang.String sIdent, FieldData identInfo)
sIdent
- identInfo
- public FieldData getField(java.lang.String name)
name
- The name of the field. The field can be local or in super scopes.public java.lang.String xxxwriteStructOwnClassFields(int recursion)
public java.lang.String getAllTypeIdents()
public java.util.Set<java.util.Map.Entry<java.lang.String,JavaSources.ClassDataOrJavaSrcFile>> getTypeSet()
public java.lang.String getSourceOfClassData()
public java.lang.String toString()
toString
in class java.lang.Object