FunLog++ - History - Cooperation - Frontend - Interpreter - Semantic List - Target Code
FunLog++ Semantic List
Link Code - NoLink - Packed Link - Other Code List Elements - example source file - semantic list

This file is helpful for people who want to implement a new FunLog++ code generator or who want to maintain the original FunLog++ system software.

The semantic list is an internal data structure of the FunLog++ compiler. It serves a general interface for (almost) all FunLog++ code generators. The only exception currently is the code generator to Delphi Pascal which directly accesses the syntax tree.

A FunLog++ semantic list consists of a sequence of FunLog++ class code definitions. A FunLog++ class code definition consists of its class signature and a list of its method code definitions. A FunLog++ method code definition consists of its method signature, the determination of the SELF parameter (if present), and the method body's code link. With class code there additionally is an explanation name which is intented to be used for error or debug messages.

 Method signature and class signature consist of the method or class name and its parameters. Signatures occur in defining and applying locations.



Link Code

Link code is a data structure to represent the code generator interface for a FunLog++ method body. The link code has one of few differenty types.

The aggregation link simply combines a sequence of  some links which have to be executed at runtime one after another. Another simple link type is the assign link where some variable gets the value of some object or of some other variable. The data link code has two attributes. The value reference determines where the result has to be stored to. The class signature refers to one of the class codes in the code list. The data link is the only semantic list concept in order to refer to a class definition (from any where). With the lazy link the evaluation of some FunLog++ command may be delayed until the result of that link is actually required. The system link is introduced in order to easily access target language procedures and data from within a FunLog++ program. The system link appears semantic lists for  FunLog++ standard library code only. Sometimes error conditions have to be transferred in to the code list as an error link. These refer to syntax error or semantic error as far as they could be detected from the FunLog++ compiler.. Then there are three type of links which send some comand to some specific context. The receiver link explicitly determines the receiver object of some FunLog++ command. The top link sends the given command to the outmost class object which automatically exists for each defined class. The local link send its command to that SELF object where the messages occured in the FunLog++ source program.

NoLink

The nolink is a dummy for places where a link is expected but nothing is to be done.



Packed Link

The packed link is no real separate link to be regarded by the code generator. Instead this is a data structure which might appear instead of some link and which has to be expanded to a proper link.



Other Code List Elements
 











Example
 
source file PRIMO.FUN
    result    ::= 8-5.
    standard  ::= {
      number(A) ::= {
        SELF - B  ::= :platform_number_minus(A,B).
        }.
      }.
    platform_number_minus(X,Y) ::= '=systemcall='(Res, is(Res,X-Y) ).

 
semantic list for PRIMO.FUN
  [
  ::=( 'PRIMO'(_), "PRIMO", 
    [
      ::=( result(A), 0, '=aggr='([ assign(B,8), assign(C,5), '-'(A,B,C) ]) ),
      ::=( standard(D), 0,'=data=(D,'$1standard'(D)) ),
      ::=( platform_number_minus(E,F,G), 0, '=systemcall='(E, is(E,F-G)) )
    ]),
  ::=( '$1standard'(_), "standard",
    [
      ::=( number(A,B), 2, '=data='(A,'$1standard$2number'(A,B)) )
    ]),
  ::=( '$1standard$2number'(_,A), "number",
    [
      ::=( '-'(B,A,C), 2, '=aggr='(['=assign='(D,'PRIMO'(_)), ':'(D,platform_number_minus(B,A,C) ]) ) 
    ])
  ]

 
 
FunLog++ - History - Cooperation - Frontend - Interpreter - Semantic List - Target Code
Last modification: Dieter Schmidt / Bernhard Pohl 14.October 1997 / 24.Oktober 2000