TaPAS  0.2
Functions
armoise-interp.h File Reference

Interpreter of ARMOISE syntactic trees. More...

#include <ccl/ccl-exception.h>
#include <armoise/armoise-tree.h>
#include <armoise/armoise.h>

Go to the source code of this file.

Functions

 CCL_DECLARE_EXCEPTION (armoise_interp_exception, exception)
 Exception raised on static semantics error.
 
void armoise_interp_definition (armoise_context *context, armoise_tree *tdef, ccl_list *ids) CCL_THROW(armoise_interp_exception)
 Interpretation of the ARMOISE definition tdef and integration to the context context. More...
 
ccl_treearmoise_interp_predicate (armoise_context *context, armoise_tree *P) CCL_THROW(armoise_interp_exception)
 Interpretation of the ARMOISE predicate P under the context context. More...
 

Detailed Description

Interpreter of ARMOISE syntactic trees.

This module proposes two functions that allows to interpret the syntactic trees of ARMOISE definitions or predicates into data structures defined in armoise.h.

Each function may raise an armoise_interp_exception if the armoise_tree is inconsistent with some parts of the static semantics of ARMOISE.

Definition in file armoise-interp.h.

Function Documentation

void armoise_interp_definition ( armoise_context context,
armoise_tree tdef,
ccl_list ids 
)

Interpretation of the ARMOISE definition tdef and integration to the context context.

This function interprets the syntactic tree tdef as a definition or parallel definition of predicates. Each definition is interpreted under context (and its parents). Each newly created predicate is added to context. If ids is not null then identifiers of predicates are stored in this list.

Parameters
contextthe context in which the syntactic tree is interpreted.
tdefthe syntactic tree of the definition
idsthe list that receives identifiers of created predicates
Precondition
context != NULL
tdef != NULL
tdef->node_type == ARMOISE_TREE_DEFINITION
Exceptions
armoise_interp_exceptionif the syntactic tree is not consistent with the static semantics of the language.
ccl_tree* armoise_interp_predicate ( armoise_context context,
armoise_tree P 
)

Interpretation of the ARMOISE predicate P under the context context.

This function interprets the syntactic tree P as a predicate and return it into a ccl_tree. P is interpreted under context (and its parents.

The function returns a ccl_tree whose leaves are armoise_predicate}s. The structure of the ccl_tree corresponds to the structure of the parallel definition (using <.> construction) of the predicate (s).

Parameters
contextthe context in which the syntactic tree is interpreted.
Pthe syntactic tree of the predicate(s)
Precondition
P != NULL
P->node_type == ARMOISE_TREE_PREDICATE
Exceptions
armoise_interp_exceptionif the syntactic tree is not consistent with the static semantics of the language.
Returns
a ccl_tree encoding the predicate P.