Some even have 'abstract' in their names.
Signed-off-by: Jean Privat <jean@pryen.org>
class FilterIStream
super IStream
# Filter readed elements
- readable var _stream: nullable IStream
+ readable var _stream: nullable IStream = null
redef fun eof: Bool
do
class FilterOStream
super OStream
# Filter outputed elements
- readable var _stream: nullable OStream
+ readable var _stream: nullable OStream = null
# Can the stream be used to write
redef fun is_writable: Bool
module opts
# Super class of all option's class
-class Option
+abstract class Option
# Names for the option (including long and short ones)
readable var _names: Array[String]
end
# Option with one mandatory parameter
-class OptionParameter
+abstract class OptionParameter
super Option
protected fun convert(str: String): VALUE is abstract
import abstract_collection
# One dimension array of objects.
-class AbstractArrayRead[E]
+abstract class AbstractArrayRead[E]
super SequenceRead[E]
redef readable var _length: Int = 0
end
# Resizable one dimension array of objects.
-class AbstractArray[E]
+abstract class AbstractArray[E]
super AbstractArrayRead[E]
super Sequence[E]
import hash
# A HashCollection is an array of HashNode[K] indexed by the K hash value
-private class HashCollection[K: Object, N: HashNode[K]]
+private abstract class HashCollection[K: Object, N: HashNode[Object]]
super ArrayCapable[nullable N]
var _array: nullable NativeArray[nullable N] = null # Used to store items
end
end
-private class HashNode[K: Object]
+private abstract class HashNode[K: Object]
var _key: K
type N: HashNode[K]
readable writable var _next_item: nullable N = null
import array
# This abstract class generalizes ways to sort an array
-class AbstractSorter[E: Object]
+interface AbstractSorter[E: Object]
# Compare `a' and `b'.
# Returns:
# -1 if a < b
# Simple sub-processus
class Process
-
# The pid of the processus
fun id: Int do return _data.id
end
# File Abstract Stream
-class FStream
+abstract class FStream
super IOS
# The path of the file.
readable var _path: nullable String = null
import string
# Abstract stream class
-class IOS
+interface IOS
# close the stream
fun close is abstract
end
# Abstract input streams
-class IStream
+interface IStream
super IOS
# Read a character. Return its ASCII value, -1 on EOF or timeout
fun read_char: Int is abstract
end
# Abstract output stream
-class OStream
+interface OStream
super IOS
# write a string
fun write(s: String) is abstract
end
# Input streams with a buffer
-class BufferedIStream
+abstract class BufferedIStream
super IStream
redef fun read_char
do
end
end
-class IOStream
+interface IOStream
super IStream
super OStream
end
##############################################################"
-class FDStream
+abstract class FDStream
super IOS
# File description
var _fd: Int
end
# StringCapable objects can create native strings
-class StringCapable
+interface StringCapable
protected fun calloc_string(size: Int): NativeString is intern
end
import syntax
private import nit_version
-class AbstractCompiler
+abstract class AbstractCompiler
super ToolContext
init(tool_name: String)
import program
# Something that store color of table elements
-class ColorContext
+abstract class ColorContext
var _colors: HashMap[TableElt, Int] = new HashMap[TableElt, Int]
# The color of a table element.
###############################################################################
# An element of a class, an instance or a module table
-abstract class AbsTableElt
+interface AbsTableElt
end
# An element of a class or an instance table
# Such an elements represent method function pointers, attribute values, etc.
-abstract class TableElt
+interface TableElt
super AbsTableElt
# Is the element conflict to class `c' (used for coloring)
fun is_related_to(c: MMLocalClass): Bool is abstract
# An element of a module table
# Such an elements represent colors or identifiers
-abstract class ModuleTableElt
+interface ModuleTableElt
super AbsTableElt
end
end
# An element representing a class information
-class AbsTableEltClass
+abstract class AbsTableEltClass
super AbsTableElt
# The local class where the information comes from
readable var _local_class: MMLocalClass
end
# An element of a class table representing a class information
-class TableEltClass
+abstract class TableEltClass
super TableElt
super AbsTableEltClass
redef fun is_related_to(c)
# Subclasses of this class would represent an analysis that produces
# at least a way of knowing if a class is instantiated somewhere in a
# method that is reachable from the entry point of the program
-class InstantiatedTypeAnalysis
+interface InstantiatedTypeAnalysis
fun is_class_instantiated(local_class: MMLocalClass): Bool is abstract
end
# at least a way of knowing if an initializer is called at least once
# as an initializer (and not as part of another initializer)
# in a specific class
-class ReachableAsInitAnalysis
+interface ReachableAsInitAnalysis
fun is_method_reachable_as_init(method: MMMethod, c: MMLocalClass): Bool is abstract
end
# Subclasses of this class would represent an analysis that produces
# at least a way of knowing if a property is reachable from at least
# one init in the program
-class ReachableFromInitMethodAnalysis
+interface ReachableFromInitMethodAnalysis
fun is_iroutine_reachable_from_init(ir: nullable IRoutine): Bool is abstract
fun is_method_reachable_from_init(method: MMMethod): Bool is abstract
end
# Subclasses of this class would represent an analysis that produces
# at least a way of knowing if a property is reachable from the entry
# point of the program
-class ReachableMethodAnalysis
+interface ReachableMethodAnalysis
fun is_iroutine_reachable(ir: nullable IRoutine): Bool is abstract
fun is_method_reachable(method: MMMethod): Bool is abstract
end
import icode_builder
# A simple visitor to visit icode structures
-class ICodeVisitor
+abstract class ICodeVisitor
# Called when a iregister is read in a icode
fun visit_iregister_read(ic: ICode, r: IRegister) do end
import location
# The main singleton which knows everything
-class MMContext
+abstract class MMContext
init do end
end
# A module is a Nit file
-class MMModule
+abstract class MMModule
# Global context
readable var _context: MMContext
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
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
end
# Attribute local properties
-class MMAttribute
+abstract class MMAttribute
super MMLocalProperty
end
end
# Method local properties
-class MMMethod
+abstract class MMMethod
super MMLocalProperty
# Is the method defined with intern
fun is_intern: Bool is abstract
end
# Concrete local classes
-class MMConcreteClass
+abstract class MMConcreteClass
super MMLocalClass
end
end
end
-class MMTypeClass
+abstract class MMTypeClass
super MMType
redef readable var _local_class: MMLocalClass
redef fun mmmodule do return _local_class.mmmodule end
end
# Formal types are named indirect types
-class MMTypeFormal
+abstract class MMTypeFormal
super MMType
redef fun is_valid do return _bound != null and _bound.is_valid
end
# Virtual type properties
-class MMTypeProperty
+abstract class MMTypeProperty
super MMLocalProperty
# The virtual static type associated
fun stype_for(recv: MMType): nullable MMVirtualType
end
# A load handler know how to load a specific module type
-class ModuleLoader
+interface ModuleLoader
# Type of module loaded by the loader
type MODULE: MMModule
end
# Generalization of metamodel entities
-class MMEntity
+interface MMEntity
# Return a link to
fun html_link(dctx: DocContext): String is abstract
class TComment
super Token
end
-class TokenKeyword
+abstract class TokenKeyword
super Token
redef fun to_s
do
class TAssign
super Token
end
-class TokenOperator
+abstract class TokenOperator
super Token
redef fun to_s
do
do return "attribute '{text}'"
end
end
-class TokenLiteral
+abstract class TokenLiteral
super Token
redef fun to_s
do
readable var _n_kwmodule: TKwmodule
readable var _n_name: AModuleName
end
-class AImport super Prod end
+abstract class AImport super Prod end
class AStdImport
super AImport
readable var _n_visibility: AVisibility
readable var _n_kwimport: TKwimport
readable var _n_kwend: TKwend
end
-class AVisibility super Prod end
+abstract class AVisibility super Prod end
class APublicVisibility
super AVisibility
end
super AVisibility
readable var _n_kwintrude: TKwintrude
end
-class AClassdef super Prod
+abstract class AClassdef super Prod
readable var _n_propdefs: List[APropdef] = new List[APropdef]
end
class AStdClassdef
class AMainClassdef
super AClassdef
end
-class AClasskind super Prod end
+abstract class AClasskind super Prod end
class AConcreteClasskind
super AClasskind
readable var _n_kwclass: TKwclass
readable var _n_kwsuper: nullable TKwsuper = null
readable var _n_type: AType
end
-class APropdef super Prod
+abstract class APropdef super Prod
readable var _n_doc: nullable ADoc = null
end
class AAttrPropdef
if n_id != null then return n_id.location else return n_id2.location
end
end
-class AMethPropdef
+abstract class AMethPropdef
super APropdef
readable var _n_kwredef: nullable TKwredef = null
readable var _n_visibility: nullable AVisibility
super AMethPropdef
readable var _n_kwmeth: TKwmeth
end
-class AExternPropdef
+abstract class AExternPropdef
super AMethPropdef
readable var _n_extern: nullable TString = null
readable var _n_extern_calls: nullable AExternCalls = null
readable var _n_kwmeth: nullable TKwmeth
readable var _n_block: nullable AExpr = null
end
-class AInitPropdef
+abstract class AInitPropdef
+ super AMethPropdef
end
class AConcreteInitPropdef
super AConcreteMethPropdef
readable var _n_kwimport: TKwimport
readable var _n_extern_calls: List[AExternCall] = new List[AExternCall]
end
-class AExternCall
+abstract class AExternCall
super Prod
end
-class APropExternCall
+abstract class APropExternCall
special AExternCall
end
class ALocalPropExternCall
special AExternCall
readable var _n_kwsuper: TKwsuper
end
-class ACastExternCall
+abstract class ACastExternCall
special AExternCall
end
class ACastAsExternCall
readable var _n_id: TClassid
readable var _n_type: AType
end
-class AAble super Prod
+abstract class AAble super Prod
readable var _n_visibility: nullable AVisibility = null
readable var _n_kwredef: nullable TKwredef = null
end
super AAble
readable var _n_kwwritable: TKwwritable
end
-class AMethid super Prod end
+abstract class AMethid super Prod end
class AIdMethid
super AMethid
readable var _n_id: TId
readable var _n_kwlabel: TKwlabel
readable var _n_id: TId
end
-class AExpr super Prod end
+abstract class AExpr super Prod end
class ABlockExpr
super AExpr
readable var _n_expr: List[AExpr] = new List[AExpr]
readable var _n_kwreturn: nullable TKwreturn = null
readable var _n_expr: nullable AExpr = null
end
-class ALabelable
+abstract class ALabelable
super Prod
readable var _n_label: nullable ALabel = null
end
readable var _n_expr: AExpr
readable var _n_else: nullable AExpr = null
end
-class AAssignFormExpr
+abstract class AAssignFormExpr
super AExpr
readable var _n_assign: TAssign
readable var _n_value: AExpr
end
-class AReassignFormExpr
+abstract class AReassignFormExpr
super AExpr
readable var _n_assign_op: AAssignOp
readable var _n_value: AExpr
super AProxyExpr
readable var _n_kwonce: TKwonce
end
-class ASendExpr
+abstract class ASendExpr
super AExpr
readable var _n_expr: AExpr
readable var _n_closure_defs: List[AClosureDef] = new List[AClosureDef]
end
-class ABinopExpr
+abstract class ABinopExpr
super ASendExpr
readable var _n_expr2: AExpr
end
-class ABoolExpr
+abstract class ABoolExpr
super AExpr
end
class AOrExpr
readable var _n_id: nullable TId = null
readable var _n_args: AExprs
end
-class AAttrFormExpr
+abstract class AAttrFormExpr
super AExpr
readable var _n_expr: AExpr
readable var _n_id: TAttrid
super AAttrFormExpr
super AAssignFormExpr
end
-class ACallFormExpr
+abstract class ACallFormExpr
super ASendExpr
readable var _n_id: TId
readable var _n_args: AExprs
end
-class ASendReassignFormExpr
+abstract class ASendReassignFormExpr
super ASendExpr
super AReassignFormExpr
end
readable var _n_kwinit: TKwinit
readable var _n_args: AExprs
end
-class ABraFormExpr
+abstract class ABraFormExpr
super ASendExpr
readable var _n_args: AExprs
end
super ABraFormExpr
super AAssignFormExpr
end
-class AVarFormExpr
+abstract class AVarFormExpr
super AExpr
readable var _n_id: TId
end
super AVarFormExpr
super AReassignFormExpr
end
-class ARangeExpr
+abstract class ARangeExpr
super AExpr
readable var _n_expr: AExpr
readable var _n_expr2: AExpr
super AExpr
readable var _n_char: TChar
end
-class AStringFormExpr
+abstract class AStringFormExpr
super AExpr
end
class AStringExpr
readable var _n_opar: TOpar
readable var _n_cpar: TCpar
end
-class AProxyExpr
+abstract class AProxyExpr
super AExpr
readable var _n_expr: AExpr
end
super AAttrFormExpr
readable var _n_kwisset: TKwisset
end
-class AExprs
+abstract class AExprs
super Prod
readable var _n_exprs: List[AExpr] = new List[AExpr]
end
readable var _n_obra: TObra
readable var _n_cbra: TCbra
end
-class AAssignOp super Prod end
+abstract class AAssignOp super Prod end
class APlusAssignOp
super AAssignOp
readable var _n_pluseq: TPluseq
readable var _n_expr: nullable AExpr = null
redef fun hot_location do return n_id.location
end
-class AClosureId
+abstract class AClosureId
super Prod
end
class ASimpleClosureId
end
# Abstract standard visitor
-class Visitor
+abstract class Visitor
# What the visitor do when a node is visited
# Concrete visitors should redefine this method.
protected fun visit(e: nullable ANode) is abstract
end
# Abstract standard visitor
-class Visitor
+abstract class Visitor
# What the visitor do when a node is visited
# Concrete visitors should redefine this method.
protected fun visit(e: nullable PNode) is abstract
###############################################################################
-class AEscapeExpr
+abstract class AEscapeExpr
super ALabelable
# The associated escapable block
readable var _escapable: nullable EscapableBlock
end
# Concrete NIT source method
-class MMSrcMethod
+abstract class MMSrcMethod
super MMMethod
redef fun is_intern do return false
redef fun is_extern do return false
end
# Concrete NIT source method for an automatic accesor
-class MMAttrImplementationMethod
+abstract class MMAttrImplementationMethod
super MMSrcMethod
redef fun node: nullable AAttrPropdef do return mmmodule.nodes(self).as(nullable AAttrPropdef)
init(name: Symbol, cla: MMLocalClass, n: AAttrPropdef)
###############################################################################
# Visitor used during the syntax analysis
-class AbsSyntaxVisitor
+abstract class AbsSyntaxVisitor
super Visitor
fun get_type_by_name(clsname: Symbol): MMType
do
fun stype: MMType is abstract
end
-class AAbsAbsSendExpr
+abstract class AAbsAbsSendExpr
super AExpr
# The signature of the called property (require is_typed)
fun prop_signature: MMSignature is abstract
fun raw_arguments: Array[AExpr] is abstract
end
-class AAbsSendExpr
+abstract class AAbsSendExpr
super AAbsAbsSendExpr
# The invoked method (require is_typed)
fun prop: MMMethod is abstract
fun return_type: nullable MMType is abstract
end
-class ASuperInitCall
+abstract class ASuperInitCall
super AAbsSendExpr
end
fun assign_method: MMMethod is abstract
end
-class ASendReassignExpr
+abstract class ASendReassignExpr
super ASendExpr
super AReassignFormExpr
# The invoked method used to read (require is_typed)
end
# An abstract control structure with feature escapable block
-class AAbsControl
+abstract class AAbsControl
super AExpr
# The corresponding escapable block
readable var _escapable: nullable EscapableBlock
end
end
-class ATypeCheckExpr
+abstract class ATypeCheckExpr
super AExpr
private fun check_expr_cast(v: TypingVisitor, n_expr: AExpr, n_type: AType)
do