Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Eclipse Projects
Eclipse Titan
titan.EclipsePlug-ins
Commits
1883f595
Commit
1883f595
authored
May 01, 2016
by
ekrisza
Browse files
style improvements
parent
07e0c049
Changes
2
Hide whitespace changes
Inline
Side-by-side
org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/ComponentTypeBody.java
View file @
1883f595
...
...
@@ -246,21 +246,18 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha
checkUniqueness
(
CompilationTimeStamp
.
getBaseTimestamp
());
}
Definition
definition
=
definitions
.
getDefinition
(
identifier
.
getName
());
final
String
name
=
identifier
.
getName
();
Definition
definition
=
definitions
.
getDefinition
(
name
);
if
(
definition
!=
null
)
{
return
true
;
}
definition
=
extendsGainedDefinitions
.
get
(
identifier
.
getN
ame
()
);
definition
=
extendsGainedDefinitions
.
get
(
n
ame
);
if
(
definition
!=
null
)
{
return
true
;
}
if
(
attributeGainedDefinitions
.
containsKey
(
identifier
.
getName
()))
{
return
true
;
}
return
false
;
return
attributeGainedDefinitions
.
containsKey
(
name
);
}
/**
...
...
@@ -274,12 +271,13 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha
checkUniqueness
(
CompilationTimeStamp
.
getBaseTimestamp
());
}
Definition
definition
=
definitions
.
getDefinition
(
identifier
.
getName
());
final
String
name
=
identifier
.
getName
();
Definition
definition
=
definitions
.
getDefinition
(
name
);
if
(
definition
!=
null
)
{
return
definition
;
}
definition
=
extendsGainedDefinitions
.
get
(
identifier
.
getN
ame
()
);
definition
=
extendsGainedDefinitions
.
get
(
n
ame
);
if
(
definition
!=
null
)
{
if
(
VisibilityModifier
.
Public
.
equals
(
definition
.
getVisibilityModifier
()))
{
return
definition
;
...
...
@@ -289,7 +287,7 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha
}
}
definition
=
attributeGainedDefinitions
.
get
(
identifier
.
getN
ame
()
);
definition
=
attributeGainedDefinitions
.
get
(
n
ame
);
if
(
definition
!=
null
)
{
if
(
VisibilityModifier
.
Public
.
equals
(
definition
.
getVisibilityModifier
()))
{
return
definition
;
...
...
@@ -304,20 +302,20 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha
@Override
public
boolean
hasAssignmentWithId
(
final
CompilationTimeStamp
timestamp
,
final
Identifier
identifier
)
{
// only the visible ones
Definition
definition
=
definitions
.
getDefinition
(
identifier
.
getN
ame
()
);
final
String
name
=
identifier
.
getName
();
Definition
definition
=
definitions
.
getDefinition
(
n
ame
);
if
(
definition
!=
null
)
{
return
true
;
}
definition
=
extendsGainedDefinitions
.
get
(
identifier
.
getN
ame
()
);
definition
=
extendsGainedDefinitions
.
get
(
n
ame
);
if
(
definition
!=
null
)
{
if
(
VisibilityModifier
.
Public
.
equals
(
definition
.
getVisibilityModifier
()))
{
return
true
;
}
}
definition
=
attributeGainedDefinitions
.
get
(
identifier
.
getN
ame
()
);
definition
=
attributeGainedDefinitions
.
get
(
n
ame
);
if
(
definition
!=
null
)
{
if
(
VisibilityModifier
.
Public
.
equals
(
definition
.
getVisibilityModifier
()))
{
return
true
;
...
...
@@ -333,7 +331,7 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha
}
@Override
public
Assignment
getAssBySRef
(
final
CompilationTimeStamp
timestamp
,
final
Reference
reference
,
IReferenceChain
refChain
)
{
public
Assignment
getAssBySRef
(
final
CompilationTimeStamp
timestamp
,
final
Reference
reference
,
final
IReferenceChain
refChain
)
{
if
(
reference
.
getModuleIdentifier
()
!=
null
)
{
return
getParentScope
().
getAssBySRef
(
timestamp
,
reference
);
}
...
...
@@ -342,12 +340,13 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha
checkUniqueness
(
timestamp
);
}
Definition
definition
=
definitions
.
getDefinition
(
reference
.
getId
().
getName
());
final
String
name
=
reference
.
getId
().
getName
();
Definition
definition
=
definitions
.
getDefinition
(
name
);
if
(
definition
!=
null
)
{
return
definition
;
}
definition
=
extendsGainedDefinitions
.
get
(
reference
.
getId
().
getN
ame
()
);
definition
=
extendsGainedDefinitions
.
get
(
n
ame
);
if
(
definition
!=
null
)
{
if
(
VisibilityModifier
.
Public
.
equals
(
definition
.
getVisibilityModifier
()))
{
return
definition
;
...
...
@@ -358,7 +357,7 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha
return
null
;
}
definition
=
attributeGainedDefinitions
.
get
(
reference
.
getId
().
getN
ame
()
);
definition
=
attributeGainedDefinitions
.
get
(
n
ame
);
if
(
definition
!=
null
)
{
if
(
VisibilityModifier
.
Public
.
equals
(
definition
.
getVisibilityModifier
()))
{
return
definition
;
...
...
@@ -401,7 +400,7 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha
* @return the collected component type bodies.
* */
private
List
<
ComponentTypeBody
>
getAttributeExtendsInheritedComponentBodies
()
{
List
<
ComponentTypeBody
>
result
=
new
ArrayList
<
ComponentTypeBody
>();
final
List
<
ComponentTypeBody
>
result
=
new
ArrayList
<
ComponentTypeBody
>();
LinkedList
<
ComponentTypeBody
>
toBeChecked
=
new
LinkedList
<
ComponentTypeBody
>(
attrExtendsReferences
.
getComponentBodies
());
while
(!
toBeChecked
.
isEmpty
())
{
ComponentTypeBody
body
=
toBeChecked
.
removeFirst
();
...
...
@@ -417,43 +416,6 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha
return
result
;
}
/**
* Traverse the attribute extension hierarchy and check all components in it,
* to see if there is a definition with the provided name.
*
* Please note, that semantic checking is not done here.
* That should be performed before, but not required.
*
* @param id the name to search for.
* @return the definition reachable in the extension hierarchy or null if non found.
* */
private
Definition
getAttributesInheritedDefinition
(
final
Identifier
id
)
{
if
(
attrExtendsReferences
==
null
)
{
return
null
;
}
final
String
temporalName
=
id
.
getName
();
final
List
<
ComponentTypeBody
>
bodies
=
attrExtendsReferences
.
getComponentBodies
();
if
(
bodies
==
null
)
{
return
null
;
}
for
(
ComponentTypeBody
body
:
bodies
)
{
Map
<
String
,
Definition
>
subDefinitionMap
=
body
.
getDefinitionMap
();
if
(
subDefinitionMap
.
containsKey
(
temporalName
))
{
return
subDefinitionMap
.
get
(
temporalName
);
}
Definition
temp
=
body
.
getAttributesInheritedDefinition
(
id
);
if
(
temp
!=
null
)
{
return
temp
;
}
}
return
null
;
}
/**
* Adds assignments (right now only definitions) the this component type
...
...
@@ -935,15 +897,11 @@ public final class ComponentTypeBody extends TTCN3Scope implements IReferenceCha
}
}
}
if
(
extendsReferences
!=
null
)
{
if
(!
extendsReferences
.
accept
(
v
))
{
return
false
;
}
if
(
extendsReferences
!=
null
&&
!
extendsReferences
.
accept
(
v
))
{
return
false
;
}
if
(
attrExtendsReferences
!=
null
)
{
if
(!
attrExtendsReferences
.
accept
(
v
))
{
return
false
;
}
if
(
attrExtendsReferences
!=
null
&&
!
attrExtendsReferences
.
accept
(
v
))
{
return
false
;
}
if
(
v
.
leave
(
this
)==
ASTVisitor
.
V_ABORT
)
{
return
false
;
...
...
org.eclipse.titan.designer/src/org/eclipse/titan/designer/AST/TTCN3/types/ComponentTypeReferenceList.java
View file @
1883f595
...
...
@@ -125,7 +125,7 @@ public final class ComponentTypeReferenceList extends ASTNode implements ILocate
for
(
Reference
reference
:
componentReferences
)
{
Component_Type
componentType
=
reference
.
chkComponentypeReference
(
timestamp
);
if
(
componentType
!=
null
)
{
ComponentTypeBody
compTypeBody
=
(
componentType
)
.
getComponentBody
();
ComponentTypeBody
compTypeBody
=
componentType
.
getComponentBody
();
if
(
compTypeBody
!=
null
)
{
if
(
componentTypeBodies
.
containsKey
(
compTypeBody
))
{
componentTypeBodies
.
get
(
compTypeBody
).
getId
().
getLocation
().
reportSingularSemanticError
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment