public static class CheaderParser.StructDefinition extends CheaderParser.StructOrClassDef
Modifier and Type | Field and Description |
---|---|
CheaderParser.Arraysize |
arraysize
Used in an innerStructAttribute.
|
java.lang.String |
conditionDef
If set the struct is conditionally defined in the header file.
|
java.lang.String |
conditionDefNot
If set the struct is conditionally defined in the header file.
|
(package private) static int |
ctUnifiedImplicitelyStructName |
boolean |
isInnerStruct |
boolean |
isUnion |
CheaderParser.AttributeOrTypedef |
superclass
In a struct a superclass is a struct on start of the struct (nested).
|
java.lang.String |
tagname |
attribs, innerName, name, sBasedOnObjectJc
compilerError, currEntry, entries, headerBlockName, headerBlockNameDescr, invalidBlock_, isConst, parent, visibity
description, implementDescriptions, static_, virtual_, visibility, whatisit
Constructor and Description |
---|
StructDefinition(CheaderParser.HeaderBlock parent,
java.lang.String whatisit,
boolean isUnion,
boolean isInnerStruct) |
Modifier and Type | Method and Description |
---|---|
void |
add_attribMacro(CheaderParser.AttribAsMacro val) |
void |
add_attribute(CheaderParser.AttributeOrTypedef val)
Adds the attribute in the struct additional to
CheaderParser.HeaderBlock.entries . |
void |
add_innerStructAttribute(CheaderParser.StructDefinition val)
Called from ZBNF:
structContent:: ... struct\W <structDefinition? |
void |
add_innerUnionAttribute(CheaderParser.StructDefinition val)
An innerUnionAttribute is a fully parsed union with or without a name.
|
java.lang.String |
baseName(java.lang.String... maybesuffix) |
private static java.lang.String |
checkNameSuffix(java.lang.String name,
java.lang.String... maybesuffix)
Returns name without suffix if a suffix is recognized.
|
java.lang.String |
name()
Returns a name of the struct.
|
CheaderParser.AttribAsMacro |
new_attribMacro() |
CheaderParser.StructDefinition |
new_innerStructAttribute()
It is a struct definition maybe with tag name but without type name, because it is inner.
|
CheaderParser.StructDefinition |
new_innerUnionAttribute() |
void |
set_name(java.lang.String val) |
void |
set_tagname(java.lang.String val) |
java.lang.String |
toString() |
add_abstractMethod, add_classDecl, add_classDef, add_conditionBlock, add_const_initializer, add_constDef, add_defineDefinition, add_enumDecl, add_enumDefinition, add_fnPointer, add_friendClassDef, add_implementDescription, add_includeDef, add_inlineMethod, add_invalidBlock, add_methodDef, add_methodPtrTypedef, add_methodTypedef, add_null_initializer, add_staticMethod, add_structContentInsideCondition, add_structDecl, add_structDefinition, add_typedef, add_undefDefinition, add_unionDefinition, add_virtualMethod, new_abstractMethod, new_attribute, new_classDecl, new_classDef, new_conditionBlock, new_const_initializer, new_constDef, new_defineDefinition, new_enumDecl, new_enumDefinition, new_fnPointer, new_friendClassDef, new_implementDescription, new_includeDef, new_inlineMethod, new_invalidBlock, new_methodDef, new_methodPtrTypedef, new_methodTypedef, new_null_initializer, new_staticMethod, new_structContentInsideCondition, new_structDecl, new_structDefinition, new_typedef, new_undefDefinition, new_unionDefinition, new_virtualMethod, set_const, set_constDef, set_modifier
static int ctUnifiedImplicitelyStructName
public java.lang.String conditionDef
public java.lang.String conditionDefNot
public final boolean isUnion
public final boolean isInnerStruct
public CheaderParser.AttributeOrTypedef superclass
public java.lang.String tagname
public CheaderParser.Arraysize arraysize
StructDefinition(CheaderParser.HeaderBlock parent, java.lang.String whatisit, boolean isUnion, boolean isInnerStruct)
public void set_name(java.lang.String val)
public void set_tagname(java.lang.String val)
public CheaderParser.StructDefinition new_innerStructAttribute()
public void add_innerStructAttribute(CheaderParser.StructDefinition val)
structContent:: ... struct\W <structDefinition?+innerStructAttribute>
val
- The parsed inner structstructNameTypeOffs
is removed. It is faulty for struct type_t {...} type_s;
because it can't be deduce from the tag name to the struct name. The last one is need for reflection generation.
The Reflection generator Cheader2Refl.jztxt.cmd was improved. The element structNameTypeOffs
is no more necessary.public CheaderParser.StructDefinition new_innerUnionAttribute()
public void add_innerUnionAttribute(CheaderParser.StructDefinition val)
typedef struct MyType_t { union( MyBaseType super; ObjectJc object; MyInterface ifxy; };The superclass should be the first member of the union because const initalizing with
{ ... }
does not work elsewhere,
it is from C language.
Because that the first element of the union can be detected as the super class.
val
- public void add_attribute(CheaderParser.AttributeOrTypedef val)
CheaderParser.HeaderBlock.entries
.
Invokes super.HeaderBlock#add_attribute(AttributeOrTypedef)
.add_attribute
in class CheaderParser.HeaderBlock
union{ Type super; ObjectJc object;};
to express it.CheaderParser.HeaderBlock.add_attribute(org.vishia.header2Reflection.CheaderParser.AttributeOrTypedef)
public CheaderParser.AttribAsMacro new_attribMacro()
public void add_attribMacro(CheaderParser.AttribAsMacro val)
private static java.lang.String checkNameSuffix(java.lang.String name, java.lang.String... maybesuffix)
name
- maybesuffix
- public java.lang.String baseName(java.lang.String... maybesuffix)
public java.lang.String name()
struct tagname { ...};
public java.lang.String toString()
toString
in class java.lang.Object