File mu/semantics

This file contains all kinds of classes providing a skeleton for behaviour needed by the ParseTom tom parser.

class mu.Alias

An alias is a redeclaration of a MetaVariable.

Inherits

State supers
StateAttribute

instance mu.Alias

variables

public MetaVariable original;
The original.

methods

boolean
  isAlias;
Return TRUE.

void
  set_original Attribute variable
pre
  !original && [variable isVariable];
Be informed of the original of this alias.

void
  register;
Tell the extension about the receiving alias.


class mu.AnyExpression

Inherits

State supers
Expression, AnyThing

instance mu.AnyExpression

methods

id
  init;
Designated allocator.


class mu.AnyThing

Inherits

State supers
mu

instance mu.AnyThing


class mu.AnyType

Inherits

State supers
Type, AnyThing

variables

static AnyType shared;
The shared any type.

methods

instance (id)
  shared;
Designated allocator.

instance mu.AnyType


class mu.Argument

An argument is a parameter or tuple of parameters to a method.

Inherits

State supers
Variable

instance mu.Argument

variables

public mutable Expression default_value;
Default argument value.

methods

deferred void
  feedArgumentSinglesTo CustomMethod m;
Undocumented.


class mu.ArgumentSingle

Inherits

State supers
VariableSingle, Argument

instance mu.ArgumentSingle

methods

void
  feedArgumentSinglesTo CustomMethod m;
Undocumented.


class mu.ArgumentTuple

Inherits

State supers
VariableTuple, Argument

instance mu.ArgumentTuple

methods

void
  feedArgumentSinglesTo CustomMethod m;
Undocumented.

void
  resolveReturnNamesInMethod CustomMethod m;
Undocumented.

ArgumentSingle
  returnValueNamed tom.String name;
Undocumented.


class mu.ArrayReference

Inherits

State supers
Expression

instance mu.ArrayReference

variables

Expression array;
The array being indexed.
Expression index;
The index.

methods

id
  initWithArray Expression a
          index Expression i;
Designated initializer.

boolean
  isArrayReference;
Return TRUE.

tom.OutputStream
  writeFields tom.OutputStream s;
Emit the referenced.


class mu.Attribute

Inherits

State supers
Common

instance mu.Attribute

variables

Extension ext;
The extension containing the declaration of this attribute.

methods

id
  initWithExtension Extension e;
Designated initializer. Does not invoke the initializer of super.

Extension
  extension;
Return the extension ext.

boolean
  isAlias;
Return TRUE iff the receiving attribute is an alias.

boolean
  isVariable;
Return TRUE iff the receiving attribute is a variable.

Meta
  meta;
Return the meta of the extension ext.

deferred tom.String
  name;
Return the name of the receiving attribute.

deferred void
  register;
Register the receiving attribute with its extension.


class mu.BasicType

Inherits

State supers
TypeSingle

methods

protected instance (id) (t)
  createBasicType (tom.String, int) (name, kind);
Create a new basic type and add it to the basic_types.

void
  initialize boolean bare_environment;
Initialize the BasicType class. Note that this is _not_ invoked by the runtime, but by mu.

void
  addTypes tom.MutableSet set;
Add the basic types to the set.

instance mu.BasicType

variables

public int kind;
This basic type's kind.

methods

protected id
  initWithName tom.String n
          kind int k;
Designated initializer.

id
  asSeenFromInstance Instance i;
Return BT_ID in case we are BT_ETAM_ID.

Type
  instance;
Undocumented.

redefine boolean
  isBasicType;
Undocumented.

Type
  meta;
Undocumented.


class mu.ClassReference

Inherits

State supers
Expression

instance mu.ClassReference

methods

id
  initWithClass Class c;
Designated initializer.


class mu.Cast

Inherits

State supers
Expression

methods

instance (id)
  cast Expression e
    to Type t;
Designated allocator.

instance mu.Cast

variables

Type desired_type;
The type of the result.
Expression expr;
The expression to fit.

methods

protected id
  initWithDesiredType Type t
           expression Expression e;
Designated initializer.

tom.OutputStream
  writeFields tom.OutputStream s;
Emit the expr.


class mu.Common

Inherits

State supers
tom.State, gps.FileElement, tom.Conditions, mu

methods

redefine instance (id) (new_object)
  alloc;
Designated allocator, overridden to invoke updateLocation on the returned object. Direct subclasses of Common do not need to do a [super init], which presents significant speedup.

instance (id) (new_object)
  alloc Common object;
Similar to alloc, but set the location information of the new_object from the argument object. If object is nil, this performs the same function as (argumentless) alloc.

instance mu.Common

variables

public mutable tom.String containing_file;
The file containing this thing.
public mutable int line;
The associated line number.

methods

void
  updateLocation;
Update the location information from (the lexer of) the current parser.

void
  updateLocation Common other;
Update the location from the other.

tom.OutputStream
  describeLocation tom.OutputStream s
               for gps.Parser parser;
Emit the containing_file and line.

boolean
  isError;
Only errors are errors.

boolean
  isTuple;
Only tuples are tuples.

int
  numFlatElements;
Return the number of non-tuple elements in this object. Default implementation returns 1.

tom.OutputStream
  writeFields tom.OutputStream s;
Describe the location, if it is not nil.


class mu.Expression

An Expression is something with a (deducable) type.

Inherits

State supers
Typed

instance mu.Expression

methods

id
  again;
Return this expression again.

boolean
  isArrayReference;
Return TRUE if the receiving expression is an array reference. The default implementation returns FALSE.

boolean
  isStringConstant;
Return TRUE if the receiving expression is a constant string. The default implementation returns FALSE.


class mu.ExpressionTuple

Inherits

State supers
Expression, Tuple

instance mu.ExpressionTuple

methods

boolean
  isTuple;
Return YES.

tom.OutputStream
  writeFields tom.OutputStream s;
Direct at the Tuple.


class mu.LocalVariable

Inherits

State supers
VariableSingle

instance mu.LocalVariable

variables

public mutable Compound container;
The compound containing this declaration.

methods

id
  initWithName tom.String n
          type Type t
     container Compound c;
Designated initializer.


class mu.MetaVariable

Inherits

State supers
StateAttribute, Qualified

instance mu.MetaVariable

methods

id
  initWithName tom.String n
    qualifiers int q
          type Type t
     extension Extension e;
Designated initializer.

boolean
  isVariable;
Return TRUE.

void
  register;
Tell the extension about the receiving meta variable.


class mu.Named

A Named entity is something with a name.

Inherits

State supers
Common

instance mu.Named

variables

public tom.String name;
Our name.

methods

id (self)
  initWithName tom.String n;
Designated initializer.

id
  returnValueNamed tom.String n;
Return self if the name matches n. Used by LocalVariable and ArgumentSingle when naming (the elements of) the return value.

tom.OutputStream
  writeFields tom.OutputStream s;
Emit the name.


class mu.Qualified

A Qualified is a Common with qualifiers.

Inherits

State supers
Common, ParseTomDefines

methods

boolean
  isExtern int qualifiers;
Return the value of the extern bit in the qualifiers.

boolean
  isLocal int qualifiers;
Undocumented.

boolean
  isMutable int qualifiers;
Undocumented.

boolean
  isPrivate int qualifiers;
Undocumented.

boolean
  isProtected int qualifiers;
Undocumented.

boolean
  isPublic int qualifiers;
Undocumented.

boolean
  isStatic int qualifiers;
Undocumented.

boolean
  isRedeclare int qualifiers;
Undocumented.

boolean
  isRedefine int qualifiers;
Undocumented.

boolean
  isDeferred int qualifiers;
Undocumented.

int
          set int qualifiers
  isRedeclare boolean yes_p;
Return the qualifiers with the redeclare bit set or reset, according to yes_p.

instance mu.Qualified

variables

public int qualifiers;
The qualifiers on this object.

methods

id (self)
  initWithQualifiers int q;
Designated initializer.

boolean
  isExtern;

Qualifier testing

boolean
  isLocal;
Undocumented.

boolean
  isMutable;
Undocumented.

boolean
  isPrivate;
Undocumented.

boolean
  isProtected;
Undocumented.

boolean
  isPublic;
Undocumented.

boolean
  isStatic;
Undocumented.

boolean
  isRedeclare;
Undocumented.

boolean
  isRedefine;
Undocumented.

boolean
  isDeferred;
Undocumented.


class mu.Reference

Inherits

State supers
Expression

instance mu.Reference

variables

public Variable referenced;
The variable being referenced.

methods

id
  initWithReferenced Variable v
        fromInstance Instance m;
Designated initializer.

tom.OutputStream
  writeFields tom.OutputStream s;
Emit the referenced.


class mu.StateAttribute

Inherits

State supers
Attribute, VariableSingle

instance mu.StateAttribute

methods

id
  initWithName tom.String n
          type Type t
     extension Extension e;
Designated initializer.


class mu.Tuple

Inherits

State supers
tom.State, tom.MutableObjectArray

instance mu.Tuple

methods

redefine boolean
  isTuple;
Return YES.

int (n)
  numFlatElements;
Return the number of non-tuple elements in this tuple.

tom.OutputStream
  writeFields tom.OutputStream s;
Undocumented.

Garbage collection

void
  gc_mark_elements;
Also let the tom.State in us mark the other instance variables.


class mu.Type

Inherits

State supers
Common

instance mu.Type

methods

id
  asSeenFromInstance Instance i;
Return the type as seen from the instance i. Most important task of this method is to return id if the class specified instance (id). The default implementation simply returns self.

boolean
  equalTypeTuple TypeTuple other;
Return TRUE if the receiving type is equal to the other tuple type. The default implementation returns FALSE.

Type
  instance;
Return the instance of the receiving object type. The default implementation issues an error and returns self.

boolean
  isBasicType;
Return TRUE if this is a basic type. The default implementation returns FALSE.

boolean
  isMeta;
Return TRUE if this is an object type. The default implementation returns FALSE.

Type
  meta;
Return the meta (i.e. class) of the receiving object type. The default implementation issues an error and returns self.

deferred tom.String
  name;
Return the name of the type.


class mu.Typed

An Typed is something with a type.

Inherits

State supers
Common

instance mu.Typed

variables

public mutable Type type;
The type of this argument.

methods

id (self)
  initWithType Type t;
Designated initializer.

Type
  force_type;
Return the type, forcing it to error_type if it is nil.

tom.OutputStream
  writeFields tom.OutputStream s;
Emit the type, if it is not nil.


class mu.TypeSingle

Inherits

State supers
Named, Type

instance mu.TypeSingle


class mu.TypeTuple

Inherits

State supers
Type, Tuple

instance mu.TypeTuple

methods

boolean
  equal Type other;
Tell the other to equalTypeTuple.

boolean
  equalTypeTuple TypeTuple other;
Pass to the equal of super.

boolean
  isTuple;
Return YES.

tom.String
  name;
A tuple does not have a name.


class mu.Variable

Inherits

State supers
Typed

instance mu.Variable


class mu.VariableSingle

Inherits

State supers
Variable, Named

instance mu.VariableSingle

methods

id
  initWithName tom.String n
          type Type t;
Designated initializer.

Named (retval)
  resolveReturnNamesInMethod CustomMethod m;
If an argument to the method m with the same name as the receiving Variable exists, return that argument, otherwise return self.

Invoke the writeFields of Typed, but do the name printing self, to avoid Common doing its thing twice.
tom.OutputStream
  writeFields tom.OutputStream s;
Emit the name.


class mu.VariableTuple

Inherits

State supers
Variable, Tuple

instance mu.VariableTuple

methods

boolean
  isTuple;
Return YES.

int
  numFlatElements;
Direct at the Tuple.

tom.OutputStream
  writeFields tom.OutputStream s;
Direct at the Tuple.


Generated by tm 1.01.