Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ model_syntax — Apollo

Media Vault

Software Library

Restoration Projects

Artifacts Sought



        DSEE SYSTEM MODEL LANGUAGE SYNTAX SUMMARY

        (* See the Semantic Notes, below)


        ------------- Blocks ---------------


        Model           MODEL block_id =
                        model declarations
                        [default declaration ...]
                        [common declarations]
                        END [OF block_id];


        Aggregate       AGGREGATE block_id =
                        [default declaration ...]
                        [common declarations]
                        END [OF block_id];

        Element *       ELEMENT block_id [@ lib_id] =
                        [default declaration ...]
                        [common declarations]
                        END [OF block_id];

                        or

                        ELEMENT block_id [@ lib_id];

        External *      EXTERNAL 'pathname' =
                        [default declaration ...]
                        [common declarations]
                        END [OF block_id];

                        or

                        EXTERNAL 'pathname';


        ------------- Model Declarations ---------------


        Alias*          ALIAS {name = 'value';}...

        Environment*    ENVIRONMENT {environment_variable =
                                    'environment_variable_value';}...

        System *        SYSTEM 'system_directory_pathname';

                        Declares the system directory.


        Shell *         SHELL 'shell_pathname';

                        Declares the Shell environment for the system.


        Library *       LIBRARY {lib_id = 'library_pathname';} ...

                        Declares one or more source libraries for elements.


        Pool            POOL {pool_id = 'pool_pathname'
                                        [,'pool_pathname'] ... ; } ...

                        Declares one or more logical binary pools and their
                        possible physical locations (physical pools).


        Title           TITLE 'title_string';

                        Supplies comments about the system.


        ------------ Default Declaration -----------


        Default declaration
                        DEFAULT [FOR wildcard] =
                        [@ lib_id;]
                        [common declarations]
                        END [OF wildcard];

                        Declares default dependencies and specifications.


        ------------ Common Declarations ------------------


        Depends_source  DEPENDS_SOURCE
                        { ["["] { 'pathname'
                                | element_id [@ lib_id]
                                | block_id
                                }
                          ["]"];
                        } ...

                        Declares one or more source dependencies.


        Depends_tools   DEPENDS_TOOLS
                        { ["["] { 'tool_pathname'
                                | element_id [@ lib_id]
                                | block_id
                                }
                          ["]"];
                        } ...

                        Declares one or more tools dependencies.


        Depends_Result *
                        DEPENDS_RESULT
                            result_item ...

        result_item     { ["["] block_id ["]"];
                        | block
                        | ( default_declaration ...
                            result_item ... );
                        } ...

                        Declares one or more result dependencies.


        Use_Pool        USE_POOL pool_id;

                        Selects a particular logical pool for the results
                        of building components.


        Declare_Only    DECLARE_ONLY;

                        Declares  a  component  without making it a direct
                        dependency of the component's parent.


        Make_Visible *  MAKE_VISIBLE;

                        Makes the result of building  a  component  visible
                        outside  of the DSEE environment.


        Nil_Translation *
                        NIL_TRANSLATION;

                        Explicitly states that a component does not have  a
                        translation rule, even though it is buildable.


        Promote_Depends *
                        PROMOTE_DEPENDS;

                        Promotes  nested dependencies of a component to be
                        direct dependencies of the component's parent.


        Macro *         MACRO;

                        Groups dependencies in a  component;  makes  them
                        direct dependencies of the component's parent.


        Translate *     TRANSLATE
                        command paragraph
                        %DONE;

                        Translation rule for a system component.  "Command
                        paragraph" consists  of  lines  of  Shell  commands
                        with  special  percent symbols embedded.


        Translation Symbols

        %SOURCE
        %SOURCE(wildcard [, derived expression] [, %LEAF])
        %SOURCE(%LEAF)

                        The pathname of the primary source dependency of an
                        Element or External or a name derived from that
                        pathname.  Just the resulting leaf name is used when
                        %LEAF is given.

        %RESULT[ .text | 'text' | "text" | /text ]

                        The pathname of a derived object with the user- or
                        translator-assigned suffix.


        %RESULT_OF(wildcard)[text]

                           The pathname of derived object of directly dependent
                           component(s) matching the wildcard.

        %OPTION(option [, substitute option [default argument string]])

                           A noncritical option.

        %CR_OPT(option [, substitute option [default argument string]])

                           A critical option.

        %DONE;             Terminates translation rule.


-----------------------------------------------------------------------------

                               SEMANTIC NOTES


       o You  may  omit an Element block's library specifier (@ lib_id) only if
         the library specifier appears in a  DEFAULT  declaration  that applies
         to that Element block.

       o Model declarations except the ALIAS and ENVIRONMENT declarations may be
         specified in any order.  If either of these declarations is used, it
         must be the first declaration in the Model block.  If both ALIAS and
         ENVIRONMENT are used, ALIAS must precede ENVIRONMENT.

       o The SYSTEM and SHELL declarations are required.

       o The LIBRARY declaration is required if the system model  contains  one
         or more Element blocks.

       o The block_ID of an External block is the  "leaf name"  of  the  file's
         pathname (the name of the file without the directory path).

       o Common  declarations  may  be  specified  in  any  order,  except  the
         DEPENDS_RESULT declaration, if used, must be the last declaration in a
         block or a DEFAULT declaration.

       o Every block must contain a TRANSLATE rule, a NIL_TRANSLATION
         declaration, a PROMOTE_DEPENDS declaration, or a MACRO declaration.
         A block containing a PROMOTE_DEPENDS or MACRO declaration may
         optionally contain either a TRANSLATE or NIL_TRANSLATION declaration
         as well.

       o A DEFAULT declaration may contain, at most, one  of  the following:  a
         TRANSLATE  rule or  a  NIL_TRANSLATION  declaration.

       o A DEFAULT declaration may contain, at most, one of the following: a
         PROMOTE_DEPENDS  declaration or a MACRO declaration.

       o A PROMOTE_DEPENDS  declaration  may  only  appear  in  an  Element  or
         External block.

       o A MACRO declaration may only appear in an Aggregate.

       o A  MAKE_VISIBLE  declaration  may only appear in a buildable component
         (i.e., one that does not have a PROMOTE_DEPENDS or MACRO declaration).

       o A DEPENDS_RESULT clause in a DEFAULT declaration must reference  block
         IDs  (i.e.,  you  may  not follow a default DEPENDS_RESULT with actual
         sub-blocks).

--------------------------------------------------------------------------------------

                            SYSTEM MODEL PROCESSING DIRECTIVES

        %IF <predicate> %THEN
                text
        %ELSEIF <predicate> %THEN
                text
        %ELSE
                text
        %ENDIF              Processing conditional on value (TRUE/FALSE) of
                            predicate.


        %IFDEF <predicate> %THEN
                text
        %ELSEIFDEF <predicate> %THEN
                text
        %ELSE
                text
        %ENDIF             Processing conditional on the definition of
                           predicate in a %VAR declaration.

        %VAR name...      Lets you declare variables that you can then use as
                           predicates in directives.

        %ENABLE name...    Sets variables to true.

        %CONFIG            Lets you easily set up a warning message if you
                           forget to issue the set model command with the
                           -target compiler option.

        %EXIT              Stops the  processing of the system model.

        %ERROR 'string'    Prints 'string' as an error message.

        %WARNING 'string' Prints 'string' as a warning message.

        %INCLUDE 'pathname'
                           Includes the specified element or file as part of
                           the system model text.

        %EXPAND "("alias")"
                           Substitutes the value of an alias (as declared in
                           the system model's alias declaration).

        Semantic Notes

        predicate       Attribute  names must be declared with %VAR before
                        being used in an %IF or %ELSEIF directive.

                        A predicate is one of the following:

                             "name" - the name of a declared attribute
                             NOT predicate
                             predicate AND predicate
                             predicate OR predicate
                             "("predicate")" - to group predicates

        name            Names given on the set model command line with -TARGET
                        must also appear in a %VAR statement before being used
                        in a predicate.

                        A  name evaluates to true in a %IF or %ELSEIF statement
                        if it is included in the SET MODEL command line (with
                        the -TARGET option) or enabled in an %ENABLE statement.

                        A name evaluates to true in a %IFDEF or %ELSEIFDEF
                        statement if, and only if, it is declared with a %VAR
                        statement.

                        Declaring a name that is already declared results in
                        a  warning.  Enabling a name that is already enabled
                        results in a warning.

        %CONFIG         The  pre-declared  attribute name %CONFIG is true if
                        the -TARGET option  was  given  to  the  SET  MODEL
                        command  with  non-null arguments.

        %ERROR, %WARNING

                        %ERROR and %WARNING must be on lines by themselves.

        %INCLUDE        If  an  %INCLUDE  directive  in  the  system model
                        instructs the system model compiler to include the
                        text of a DSEE  element  in the  system  model,  the
                        compiler  uses  the  model  thread  to determine the
                        appropriate version to use.  (Type help thread_syntax
                        for information about model threads.)

        alias           This  is  the  name of an alias declared in a system
                        model ALIAS declaration.

        lines           Lines  in  the  system  model  must  exclusively
                        contain either conditional processing directives or
                        system model language text.


-----------EXAMPLE 1------------------------------------------------------------------

MODEL biblio =

    TITLE 'Bibliography manager';
    SYSTEM '//aspen/biblio/biblio_sys';
    SHELL '/com/sh';
    LIBRARY
        biblio_lib = '//aspen/biblio/biblio_lib';

    DEFAULT FOR ?*.pas =
        { Include files and translate rule used by all pascal modules }
        DEPENDS_SOURCE
            ['/sys/ins/base.ins.pas'];
            ['/sys/ins/error.ins.pas'];
            biblio_global.ins.pas;
        TRANSLATE
            /com/pas %SOURCE -comchk -opt %OPTION(-dbs) -b %RESULT
            %DONE;
        END OF ?*.pas;
    DEFAULT FOR ?* =
        @ biblio_lib;      { all modules are in biblio_lib }
        END OF ?*;

    TRANSLATE
        # Bind all modules compiled below
        /com/bind - <<!
        %RESULT_OF(?*.pas).bin
        -b %RESULT
        -end
        !
        # Export bound program by link
        crl biblio %RESULT -r
        args "Link BIBLIO created in your working directory"
        %DONE;

    DEPENDS_RESULT

        ELEMENT biblio_main.pas =
            DEPENDS_SOURCE
                biblio_commands.ins.pas;
            END OF biblio_main.pas;

        ELEMENT biblio_commands.pas =
            DEPENDS_SOURCE
                biblio_commands.ins.pas;
                biblio_sort.ins.pas;
                biblio_output.ins.pas;
            END OF biblio_commands.pas;

        ELEMENT biblio_sort.pas =
            DEPENDS_SOURCE
                biblio_sort.ins.pas;
            END OF biblio_sort.pas;

        ELEMENT biblio_output.pas =
            DEPENDS_SOURCE
                '/sys/ins/vfmt.ins.pas';
                biblio_output.ins.pas;
            END OF biblio_output.pas;

    END OF biblio;


-----------EXAMPLE 2------------------------------------------------------------------

MODEL calc =

    TITLE 'Calculator';
    SYSTEM '//aspen/calc/calc_sys';
    LIBRARY
        calc = '//aspen/calc/calc_lib';
    POOL
        calc_pool = '//helpless/calc/calc_pool';
    SHELL '/com/sh';

    DEFAULT FOR ?* =
        @ calc;
        USE_POOL calc_pool;
        END OF ?*;
    DEFAULT FOR %.pas =
        DEPENDS_TOOLS
            ['/com/pas'];
        TRANSLATE
            /com/pas %SOURCE -comchk -opt %OPTION(-dbs) -b %RESULT
            %DONE;
        END OF %.pas;

    USE_POOL calc_pool;
    TRANSLATE
        /com/bind - <<!
        %RESULT_OF(?*.pas).bin
        %RESULT_OF(calc.grammar)/build_tree.bin
        -b %RESULT
        -end
        !
        %DONE;

    DEPENDS_RESULT

        ELEMENT calc.grammar =
            DEPENDS_SOURCE
                { CALC.GRAMMAR does not have any include files, but
                  BUILD_TREE.PAS, which is generated by PARSER_GEN
                  and compiled as part of this translate rule,
                  includes the following files }
                calc.ins.pas;
                semantic_routines.ins.pas;
            DEPENDS_TOOLS
                ['//dean/tools/parser_gen'];
            MAKE_VISIBLE;
            TRANSLATE
                # Result is a directory to hold all output from
                # parser generator.  Files produced by PARSER_GEN
                # are:  BUILD_TREE.PAS, TOKENS.INS.PAS, TABLES.INS.PAS
                crd %RESULT
                args "Run PARSER_GEN ..."
                //dean/tools/parser_gen %SOURCE -out_dir %RESULT
                args "Compile generated source file ..."
                /com/pas %RESULT/build_tree %OPTION(-dbs) @
                    -b %RESULT/build_tree -idir //aspen/calc/calc_lib
                %DONE;
            END OF calc.grammar;

            (   { The modules in this default grouping use include
                  files generated from CALC.GRAMMAR and thus depend on
                  its result.  The generated include files are referenced
                  inside the files PARSER.PAS and LEXER.PAS as:
                     %INCLUDE '$(calc.grammar)/tokens.ins.pas';
                     %INCLUDE '$(calc.grammar)/tables.ins.pas'; }

                DEFAULT FOR %.pas =
                    DEPENDS_SOURCE
                         lexer.ins.pas;
                         parser.ins.pas;
                    DEPENDS_RESULT
                         calc.grammar;
                    END OF %.pas;

                ELEMENT parser.pas;

                ELEMENT lexer.pas;
            );

            ELEMENT calc.pas =
                DEPENDS_SOURCE
                    calc.ins.pas;
                    semantic_routines.ins.pas;
                    parser.ins.pas;
                END OF calc.pas;

            ELEMENT semantic_routines.pas =
                DEPENDS_SOURCE
                    semantic_routines.ins.pas;
                END OF semantic_routines.pas;

    END OF calc;

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026