nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
nitg-s&e: compile module in local knowledge
[nit.git]
/
src
/
metamodel
/
abstractmetamodel.nit
diff --git
a/src/metamodel/abstractmetamodel.nit
b/src/metamodel/abstractmetamodel.nit
index
32af390
..
71e9097
100644
(file)
--- a/
src/metamodel/abstractmetamodel.nit
+++ b/
src/metamodel/abstractmetamodel.nit
@@
-20,9
+20,10
@@
package abstractmetamodel
import partial_order
import location
import partial_order
import location
+import symbol
# The main singleton which knows everything
# The main singleton which knows everything
-class MMContext
+abstract class MMContext
init do end
init do end
@@
-107,7
+108,7
@@
class MMDirectory
end
# A module is a Nit file
end
# A module is a Nit file
-class MMModule
+abstract class MMModule
# Global context
readable var _context: MMContext
# Global context
readable var _context: MMContext
@@
-153,6
+154,11
@@
class MMModule
# Dictionary of global classes
var _global_class_by_name: Map[Symbol, MMGlobalClass] = new HashMap[Symbol, MMGlobalClass]
# Dictionary of global classes
var _global_class_by_name: Map[Symbol, MMGlobalClass] = new HashMap[Symbol, MMGlobalClass]
+ # Is a hybrid module partially implemented in extern code
+ # It is if it contains a new extern class or an
+ # extern class declaration
+ var is_extern_hybrid : Bool writable = false
+
protected init(name: Symbol, dir: MMDirectory, context: MMContext, loc: Location)
do
_name = name
protected init(name: Symbol, dir: MMDirectory, context: MMContext, loc: Location)
do
_name = name
@@
-302,6
+308,9
@@
class MMGlobalClass
# Is the global class a enum class?
readable writable var _is_enum: Bool = false
# Is the global class a enum class?
readable writable var _is_enum: Bool = false
+ # Is the global class an extern class?
+ readable writable var _is_extern: Bool = false
+
# Visibility of the global class
# 1 -> public
# 3 -> private
# Visibility of the global class
# 1 -> public
# 3 -> private
@@
-322,7
+331,7
@@
class MMGlobalClass
end
# Local classes are classes defined, refined or imported in a module
end
# Local classes are classes defined, refined or imported in a module
-class MMLocalClass
+abstract class MMLocalClass
# The name of the local class
readable var _name: Symbol
# The name of the local class
readable var _name: Symbol
@@
-492,7
+501,7
@@
class MMLocalClass
return _global_properties.has(glob)
end
return _global_properties.has(glob)
end
- # Get a local proprty by its global property
+ # Get a local property by its global property
fun [](glob: MMGlobalProperty): MMLocalProperty
do
return _local_property_by_global[glob]
fun [](glob: MMGlobalProperty): MMLocalProperty
do
return _local_property_by_global[glob]
@@
-586,7
+595,7
@@
class MMGlobalProperty
end
# Local properties are properties defined (explicitely or not) in a local class
end
# Local properties are properties defined (explicitely or not) in a local class
-class MMLocalProperty
+abstract class MMLocalProperty
# The name of the property
readable var _name: Symbol
# The name of the property
readable var _name: Symbol
@@
-648,12
+657,17
@@
class MMLocalProperty
end
# Attribute local properties
end
# Attribute local properties
-class MMAttribute
+abstract class MMAttribute
super MMLocalProperty
end
super MMLocalProperty
end
+class MMExplicitImport
+ var local_class : MMLocalClass
+ var method : MMMethod
+end
+
# Method local properties
# Method local properties
-class MMMethod
+abstract class MMMethod
super MMLocalProperty
# Is the method defined with intern
fun is_intern: Bool is abstract
super MMLocalProperty
# Is the method defined with intern
fun is_intern: Bool is abstract
@@
-661,12
+675,18
@@
class MMMethod
# Is the method abstract
fun is_abstract: Bool is abstract
# Is the method abstract
fun is_abstract: Bool is abstract
- # Is the method extern, if yes what is the extern_name
+ # Is the method extern
+ fun is_extern: Bool is abstract
+
+ # extern name when specified explicitly in nit code
fun extern_name: nullable String is abstract
fun extern_name: nullable String is abstract
+
+ # properties explicitly exported to native code
+ fun explicit_imports : Set[ MMExplicitImport ] is abstract
end
# Concrete local classes
end
# Concrete local classes
-class MMConcreteClass
+abstract class MMConcreteClass
super MMLocalClass
end
super MMLocalClass
end