mirror of
https://github.com/twiglet/cs2j.git
synced 2025-01-18 13:15:17 +01:00
add type of super to symtab
This commit is contained in:
parent
f63fa06e0f
commit
7a3229bf73
@ -67,12 +67,12 @@ scope SymTab {
|
|||||||
return AppEnv.Search($NSContext::globalNamespaces, name);
|
return AppEnv.Search($NSContext::globalNamespaces, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private TypeRepTemplate objectType = null;
|
private ClassRepTemplate objectType = null;
|
||||||
|
|
||||||
protected TypeRepTemplate ObjectType {
|
protected ClassRepTemplate ObjectType {
|
||||||
get {
|
get {
|
||||||
if (objectType == null) {
|
if (objectType == null) {
|
||||||
objectType = AppEnv.Search("System.Object");
|
objectType = (ClassRepTemplate)AppEnv.Search("System.Object", new UnknownRepTemplate("System.Object"));
|
||||||
}
|
}
|
||||||
return objectType;
|
return objectType;
|
||||||
}
|
}
|
||||||
@ -130,7 +130,9 @@ exception:
|
|||||||
|
|
||||||
primary_expression:
|
primary_expression:
|
||||||
^(INDEX expression expression_list?)
|
^(INDEX expression expression_list?)
|
||||||
| ^(APPLY expression argument_list?)
|
| ^(APPLY identifier argument_list?)
|
||||||
|
| ^(APPLY ^('.' expression identifier) argument_list?)
|
||||||
|
// | ^(APPLY expression argument_list?)
|
||||||
| ^(POSTINC expression)
|
| ^(POSTINC expression)
|
||||||
| ^(POSTDEC expression)
|
| ^(POSTDEC expression)
|
||||||
| primary_expression_start
|
| primary_expression_start
|
||||||
@ -638,7 +640,13 @@ scope NSContext,SymTab;
|
|||||||
$NSContext::namespaces.Add($NSContext::currentNS);
|
$NSContext::namespaces.Add($NSContext::currentNS);
|
||||||
$NSContext::globalNamespaces.Add($NSContext::currentNS);
|
$NSContext::globalNamespaces.Add($NSContext::currentNS);
|
||||||
// TODO: base to map to parent type
|
// TODO: base to map to parent type
|
||||||
$SymTab::symtab["this"] = AppEnv.Search($NSContext::currentNS);
|
ClassRepTemplate classTypeRep = (ClassRepTemplate)AppEnv.Search($NSContext::currentNS);
|
||||||
|
$SymTab::symtab["this"] = classTypeRep;
|
||||||
|
ClassRepTemplate parent = ObjectType;
|
||||||
|
if (classTypeRep.Inherits.Length > 0) {
|
||||||
|
parent = (ClassRepTemplate)AppEnv.Search(classTypeRep.Uses, classTypeRep.Inherits[0], ObjectType) as ClassRepTemplate;
|
||||||
|
}
|
||||||
|
$SymTab::symtab["super"] = parent;
|
||||||
}
|
}
|
||||||
class_body ) ;
|
class_body ) ;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user