SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Notation used in the following

ast_node_def(?Language, ?AstNodeLabel : atom, ?AstNodeArguments : list) is nondet

  • The Abstract Syntax Tree (AST) for the language arg1 contains

nodes with label arg2 and arguments conforming to the

  [[argument descriptors]] in arg3. The label (arg2) represents the AST node type.
  The arguments represent the AST node's id, its references to other nodes and its 
  attributes (that is, primitive values that are not references). See [[argument descriptors]]. 
* Example (excerpt from Java AST definition):
    ast_node_def(
        'Java',           % The AST of the language 'Java' ...
        callT,            % ... contains nodes of type 'callT' ...
        [                 % ... that have 7 arguments:
          ast_arg(id,      mult(1,1,no ),  id,   [callT]),
          ast_arg(parent,  mult(1,1,no ),  id,   [id]),
          ast_arg(encl,    mult(1,1,no ),  id,   [methodT, constructorT, classInitializerT,fieldT]),
          ast_arg(expr,    mult(0,1,no),   id,   [expressionType, nullType, typeRefT]),
          ast_arg(name,    mult(1,1,no ),  attr, [atom]),
          ast_arg(args,    mult(0,*,ord ), id,   [expressionType]),
          ast_arg(ref,     mult(1,1,no ),  id,   [methodT, constructorT])
        ]
    ). 
research/jtransformer/api/meta/meta-model/ast_node_def.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2024