symphonytool / symphony

The Symphony IDE
5 stars 4 forks source link

TypeChecker: What is an instantiated process/action and how does it differ from reference #216

Closed lausdahl closed 10 years ago

lausdahl commented 10 years ago

Actions:

 | {reference}
        [name]:LexNameToken
        [args]:exp*
        (actionDefinition):definition.action
    | {parametrised}
        [parametrisations]:parametrisation*
        [action]:action
 | #Instantiated;

#Instantiated {-> package='eu.compassresearch.ast.actions'}
   = {parametrised} [action]:action.parametrised  [args]:exp*
   ;

And the parametrisation:

parametrisation {-> package='eu.compassresearch.ast.actions'
                | [location]:location 
                | [declaration]:definition.local}
    = {val}
    | {res}
    | {vres}
    ;

Process:

 | {instantiation}
        [parametrisations]:parametrisation*
        [process]: process
        [args]:exp*
    | {reference}
        [processName]:LexNameToken
        [args]:exp*
        (processDefinition):definition.process

It seems to me that if the node represents a reference to an action then it should have a loose connection to what it references e.g. LexNameToken and not a process.

joey-coleman commented 10 years ago

parametrised actions look like:

'(' parametrisationList '@' action ')'
e.g.
( val x:int @ A )

and an instantiated action adds "apply parens" to the end of that:

( val x:int @ A ) (23)
lausdahl commented 10 years ago

The process instantiation looks a bit strange:

[val v = T]A()[4] the process field on AInstantiationProcess has a AReferenceProcess type and in this case it is A(). But it seems strange that it would be built like this since it would allow [val v = T]A(1,2,3)[4] based on the AST.

If the parser doesn't allow this then it would be better if the process field had a reference to the process definition that defined the process that has parameters.