The Paradigm/SP User Manual

Atanas Radenski
Computer Science Department, P.O. Box 19479
Winston-Salem State University, Winston-Salem, NC 27103
e-mail: radenski@computer.org

 
 
 
 
 

This manual describes how to compile and run Paradigm/SP programs.

< ^>    Contents

  • 1. Program Compilation
  • 2. Program Execution
  • 3. File Errors
  • 4. Compilation Errors
  • 5. Run-time Errors
  • 6. Software Limits
  • 7. Credit to Others
  • 8. References
  • 9. Related Links
  • < ^>    1. Program Compilation

    A compilation unit in Paradigm/SP is a source file representing one extensible module. The current Implementation requires that the source file has the same name as the module itself and an extension pas. The current Implementation also requires that the source file to be compiled resides in the Implementation directory.

    You can create and compile a Paradigm/SP source file in the TP IDE. In order to execute the Compiler perform the following steps:
    bullet From the Compile menu, execute the Primary File command and select pComp.pas as a primary file;
    bullet From the Run menu, execute the Run command.
    When the message

    module =

    appears in the user output screen, type the name of the module to be compiled (without the extension pas) followed by a return.


    Example: In order to compile a module named sort, use the editor to create a source file named sort.pas. Then execute the Paradigm/SP Compiler and enter the module name:
    module = sort

    If the compiler finds errors in a module, the errors are reported both on the screen and in the textile errors and no object file is output. If the compiler does not find errors, it creates an object file in the Implementation directory. The object file has the same name as the module itself and an extension obj.

    <^>    2. Program Execution

    An executable unit in Paradigm/SP is an object file containing one compiled module. The current Implementation requires that the object file to be executed resides in the Implementation directory.

    You can execute a Paradigm/SP module by running the Interpreter in the TP IDE. In order to execute the Interpreter perform the following steps:
    bullet From the Compile menu, execute the Primary File command and select pInter.pas as a primary file;
    bullet From the Run menu, execute the Run command.
    When the message

    module =

    appears in the user screen, type the name of the module to be executed (without the extension obj) followed by a return.


    Example: In order to execute a compiled module sort, execute the Paradigm/SP Interpreter and enter the module name:
    module = sort

    If a run-time error occur during module execution, the error is reported on the user output screen and the execution is canceled.

    < ^>    3. File Errors

    During program compilation or execution, the following file input errors are reported:
    bullet Module name error: At compile time, the name of a compiled module is different from its source file name. At run time, the name of a module being loaded is different from its code file name.
    bullet File error: At compile time, the source file is not found. At compile time, the symbol file for an imported or an extended module is not found or is found corrupted. At run time, the object file for an imported or an extended module is not found.
    bullet Module version error: A module is not up-to-date and must be recompiled. At compile time, this can be a module that is being imported, or module that is being extended. At run time, this can be any module that is being loaded.

    < ^>    4. Compilation Errors

    During compilation, the following program errors are reported:
    bullet Ambiguous case constant: Two case constants denote the same value.
    bullet Ambiguous identifier: A declaration introduces a second entity with the same identifier.
    bullet Forall statement error: In a restricted forall statement, (1) the element statement uses a target variable or (2) the element statement invokes an unrestricted method.
    bullet Function body error: A procedure statement occurs in the statement part of a function body.
    bullet Function parameter error: A function uses an explicit or implicit variable parameter.
    bullet Identifier kind error: A named entity of the wrong kind is used in some context. Constants, types, fields, variables, function and procedure methods are different kinds of named entities.
    bullet Import error: In an extended module, the same base module appears twice (directly or indirectly, through a chain of module extensions).
    bullet Incomplete comment: The closing delimiter } of a comment is missing.
    bullet Index range error: The index range of an array type has a lower bound that exceeds the upper bound.
    bullet Number error: A constant denotes a number outside the range of integers or reals.
    bullet Parallel statement error: In a restricted parallel statement, (1) a target variable of one process statement is also a target or an expression variable of another process statement or (2) a process statement invokes an unrestricted method.
    bullet Procedure statement error: In a restricted procedure statement, an entire variable is used more than once as a restricted actual parameter.
    bullet Recursion error: A recursive function or procedure method uses an implicit parameter.
    bullet Syntax error: The program syntax is incorrect.
    bullet Type error: The type of an operand is incompatible with its use.
    bullet Restricted method error: A restricted method  uses an implicit variable parameter.
    bullet Undefined identifier: An identifier is used without being defined.

    < ^>    5. Run-time Errors

    During program execution, the following program errors are reported:
    bullet Channel contention: Two processes both attempt to send or receive through the same channel.
    bullet Deadlock: Every process is delayed by a send or receive operation, but none of these operations match.
    bullet False assumption: An assume statement denotes a false assumption.
    bullet Message type error: Two processes attempt to communicate through the same channel, but the output expression and the input variable are of different message types.
    bullet Range error: The value of an index expression or a chr, pred, or succ function designator is out of range.
    bullet Undefined case constant: A case expression does not denote a case constant.
    bullet Undefined channel reference: A channel expression does not denote a channel.

    < ^>    6. Software Limits

    If a program is too large to be compiled or run, the software displays one of the following messages and stops. Each message indicates that the limit of a particular software array type has been exceeded:
    bullet Block limit exceeded: The total number of dynamic blocks needed for the program execution exceeds the limit maxblock. At run time, blocks are allocated for dynamic variables and for the execution of  methods,  forall statements, and process statements.
    bullet Branch limit exceeded: The total number of branches denoted by all statements in the program exceeds the limit maxlabel.
    bullet Buffer limit exceeded: The size of the compiled code exceeds the limit maxbuf.
    bullet Case limit exceeded: The number of case constants exceeds the limit maxcase.
    bullet Channel limit exceeded: The number of channels opened exceeds the limit maxchan.
    bullet Dynamic fields limit exceeded: The number of dynamic fields in a class declaration exceeds the limit maxfields.
    bullet Export limit exceeded: The number of (explicitly or implicitly) exported type structures exceeds the limit maxstruct.
    bullet Import limit exceeded: The nesting level of (explicitly or implicitly) imported (1) class fields or (2) message types exceeds the limit maxnest.
    bullet Memory limit exceeded: The program execution exceeds the limit maxaddr.
    bullet Nesting limit exceeded: The level of nesting of the compiled module and its method declarations, parallel statements, and forall statements exceeds the limit maxlevel.
    bullet String limit exceeded: The number of characters in a character string exceeds the limit maxstring.
    The standard software limits are:
     
    maxaddr = 10000 maxchan = 1000
    maxblock = 200 maxlabel = 1000
    maxbuf = 10000 maxlevel = 10
    maxcase = 128 maxstring = 81
    maxfields = 10 maximps  32
    maxphrase =           30 maxident =      16
    maxstruct =           80 maxnest =        6
    If these limits are too small for compilation or execution of a program, the limits must be increased by editing a common declaration file and recompiling both the compiler and the interpreter, as explained in [Radenski 98],  Section Software Limits.

    The following data limits have been hard-coded in the implementation and, therefore, cannot be changed by the user:
     

    minint =  -32768 maxint = 32767
    minreal = 1.5e-45 maxreal = 3.4e38

    < ^>    7. Credit to Others

    This manual adopts parts of the The SuperPascal User Manual [Brinch Hansen 93] in order to reflect language features adopted in Paradigm/SP from SuperPascal. More detailed explanations can be found in [Radenski 98], Section Credit to Others.

    < ^>    8. References

    Brinch Hansen, P. (1993) The SuperPascal User Manual. School of Computer and Information Science, Syracuse University, Syracuse, NY.

    Radenski, A. (1998) The Paradigm/SP Implementation Notes. Computer Science Department, Winston-Salem State University, Winston-Salem, NC.

    < ^ >    9. Related Links

    *Index of Manuals
    *The Paradigm Language and Its Implementation
    *Research
    *Contact

     

     

    -------------
    Last updated: October 1999.