net.sourceforge.nrl.parser.type
Interface ITypeChecker

All Known Implementing Classes:
ActionTypeChecker, ConstraintTypeChecker

public interface ITypeChecker

A type checker traverses an AST and assigns a data type to every node. After the traversal is complete, IConstraint.getNRLDataType() for a constraint will return its type.

The traveral method also returns a collection SemanticError objects in case of any type checking errors.

Use:

CAUTION: The checker relies on the AST being in absolute order. If any resolver or model resolver errors occurred previously, the type checker must not be used.

Author:
Christian Nentwich

Method Summary
 void addTypeMapping(ITypeMapping mapping)
          Add a type mapping for the checker to map model types to abstract internal types.
 List<NRLError> check(IOperators operators)
          Type check an operator collection.
 List<NRLError> check(IRuleFile ruleFile)
          Type check a rule file and assign a type to all constraints.
 

Method Detail

addTypeMapping

void addTypeMapping(ITypeMapping mapping)
Add a type mapping for the checker to map model types to abstract internal types.

Parameters:
mapping - the mapping

check

List<NRLError> check(IRuleFile ruleFile)
Type check a rule file and assign a type to all constraints.

Parameters:
ruleFile - the rule file to check
Returns:
a collection of error objects, can be empty

check

List<NRLError> check(IOperators operators)
Type check an operator collection. This assigns types to all parameters.

Parameters:
operators - the operators to check
Returns:
a collection of errors


Copyright © 2006-2013. All Rights Reserved.