Libraries
Progs Source Code
 previous   up   next 

Types
program
Type to describe a Seed7 program.

program

const type: program

Type to describe a Seed7 program.


Operator Summary
program
(attr program) . value
Default value of program (program.EMPTY).
boolean
(in program: prog1) = (in program: prog2)
Check if two program values are equal.
boolean
(in program: prog1) <> (in program: prog2)
Check if two program values are not equal.

Function Summary
string
name (in program: aProgram)
Returns the name of aProgram without path and extension.
string
path (in program: aProgram)
Return the absolute path of the program aProgram.
program
parseFile (in string: fileName, in parseOptions: options, in array string: libraryDirs, in string: protFileName)
Parse the file with the given fileName, options, libraryDirs and protFileName.
program
parseFile (in string: fileName, in parseOptions: options, in array string: libraryDirs)
Parse the file with the given fileName, options and libraryDirs.
program
parseFile (in string: fileName, in parseOptions: options)
Parse the file with the given fileName and options.
program
parseFile (in string: fileName)
Parse the file with the given fileName.
program
parseStri (in string: stri, in parseOptions: options, in array string: libraryDirs, in string: protFileName)
Parse the given string with options', libraryDirs and protFileName''.
program
parseStri (in string: stri, in parseOptions: options, in array string: libraryDirs)
Parse the given string with options' and libraryDirs''.
program
parseStri (in string: stri, in parseOptions: options)
Parse the given string with ''options'.
program
parseStri (in string: stri)
Parse the given string.
reference
evaluate (in program: aProgram, in reference: anExpression)
Evaluate anExpression which is part of aProgram.
void
execute (in program: aProgram, in array string: parameters, in parseOptions: options, in string: protFileName)
Execute aProgram with the given parameters, options and protFileName.
void
execute (in program: aProgram, in array string: parameters, in parseOptions: options)
Execute aProgram with the given parameters and options.
void
execute (in program: aProgram, in array string: parameters)
Execute aProgram with the given parameters.
void
execute (in program: aProgram)
Execute aProgram with an empty parameter list.
reference
sysVar (in program: aProgram, in string: name)
Determine the value of the system variable name in aProgram.
integer
errorCount (in program: aProgram)
Determine the number of errors in aProgram.
ref_list
globalObjects (in program: aProgram)
Determine the list of global defined objects in aProgram.
reference
syobject (in program: aProgram, in string: name)
Determine object with name from program aProgram.
reference
match (in program: aProgram, in ref_list: expression)
Determine object from program aProgram which matches expression.
boolean
isTemp (in reference: aReference)
Determine if the referenced object is temporary.
boolean
isVar (in reference: aReference)
Determine if the referenced object is variable.
void
setVar (in reference: aReference, in boolean: isVariable)
Set var flag of a referenced object.
category
category (in reference: aReference)
Get the category of a referenced object.
void
setCategory (in reference: aReference, in category: aCategory)
Set the category of aReference to aCategory.
ref_list
formalParams (in reference: funcRef)
Get the formal parameters of the function referenced by funcRef.
void
setFormalParams (in reference: funcRef, in ref_list: params)
Set the formal parameters of funcRef to params.
reference
resultVar (in reference: funcRef)
Gets the result variable of funcRef.
reference
resultInitValue (in reference: funcRef)
Gets the initialization value of the result variable of funcRef.
ref_list
localConsts (in reference: funcRef)
Gets the local constants of funcRef.
ref_list
localVars (in reference: funcRef)
Gets the local variables of funcRef.
reference
body (in reference: funcRef)
Gets the body of the function referenced by funcRef.
integer
arrayMinIdx (in reference: arrayRef)
Obtain the minimum index of the array referenced by 'arrayRef'.
integer
arrayMaxIdx (in reference: arrayRef)
Obtain the maximum index of the array referenced by 'arrayRef'.
integer
arrayLength (in reference: arrayRef)
Obtain the length of the array referenced by 'arrayRef'.
string
file (in reference: aReference)
Determine the file name of a referenced object.
integer
line (in reference: aReference)
Determine the line number of a referenced object.
integer
objNumber (in reference: aReference)
Delivers an unique number for each object

Operator Detail

. value

const program: (attr program) . value

Default value of program (program.EMPTY).


=

const func boolean: (in program: prog1) = (in program: prog2)

Check if two program values are equal.

Returns:
TRUE if both values are equal, FALSE otherwise.

<>

const func boolean: (in program: prog1) <> (in program: prog2)

Check if two program values are not equal.

Returns:
FALSE if both values are equal, TRUE otherwise.

Function Detail

name

const func string: name (in program: aProgram)

Returns the name of aProgram without path and extension. This function does not follow symbolic links. It determines, with which name a program was called. If a symbolic link refers to a program, the name of the symbolic link is returned.

Returns:
the name of the program.

path

const func string: path (in program: aProgram)

Return the absolute path of the program aProgram. This function does follow symbolic links.

Returns:
the absolute path of the program.

parseFile

const func program: parseFile (in string: fileName, in parseOptions: options, in array string: libraryDirs, in string: protFileName)

Parse the file with the given fileName, options, libraryDirs and protFileName.

Returns:
the parsed program.
Raises:
RANGE_ERROR - fileName does not use the standard path representation or fileName is not representable in the system path type.
MEMORY_ERROR - An out of memory situation occurred.

parseFile

const func program: parseFile (in string: fileName, in parseOptions: options, in array string: libraryDirs)

Parse the file with the given fileName, options and libraryDirs.

Returns:
the parsed program.
Raises:
RANGE_ERROR - fileName does not use the standard path representation or fileName is not representable in the system path type.
MEMORY_ERROR - An out of memory situation occurred.

parseFile

const func program: parseFile (in string: fileName, in parseOptions: options)

Parse the file with the given fileName and options.

Returns:
the parsed program.
Raises:
RANGE_ERROR - fileName does not use the standard path representation or fileName is not representable in the system path type.
MEMORY_ERROR - An out of memory situation occurred.

parseFile

const func program: parseFile (in string: fileName)

Parse the file with the given fileName.

Returns:
the parsed program.
Raises:
RANGE_ERROR - fileName does not use the standard path representation or fileName is not representable in the system path type.
MEMORY_ERROR - An out of memory situation occurred.

parseStri

const func program: parseStri (in string: stri, in parseOptions: options, in array string: libraryDirs, in string: protFileName)

Parse the given string with options', libraryDirs and protFileName''.

Returns:
the parsed program.
Raises:
MEMORY_ERROR - An out of memory situation occurred.

parseStri

const func program: parseStri (in string: stri, in parseOptions: options, in array string: libraryDirs)

Parse the given string with options' and libraryDirs''.

Returns:
the parsed program.
Raises:
MEMORY_ERROR - An out of memory situation occurred.

parseStri

const func program: parseStri (in string: stri, in parseOptions: options)

Parse the given string with ''options'.

Returns:
the parsed program.
Raises:
MEMORY_ERROR - An out of memory situation occurred.

parseStri

const func program: parseStri (in string: stri)

Parse the given string.

Returns:
the parsed program.
Raises:
MEMORY_ERROR - An out of memory situation occurred.

evaluate

const func reference: evaluate (in program: aProgram, in reference: anExpression)

Evaluate anExpression which is part of aProgram.

Returns:
the result of the evaluation.

execute

const proc: execute (in program: aProgram, in array string: parameters, in parseOptions: options, in string: protFileName)

Execute aProgram with the given parameters, options and protFileName.


execute

const proc: execute (in program: aProgram, in array string: parameters, in parseOptions: options)

Execute aProgram with the given parameters and options.


execute

const proc: execute (in program: aProgram, in array string: parameters)

Execute aProgram with the given parameters.


execute

const proc: execute (in program: aProgram)

Execute aProgram with an empty parameter list.


sysVar

const func reference: sysVar (in program: aProgram, in string: name)

Determine the value of the system variable name in aProgram.

Returns:
a reference to the value of the system variable or NIL if no system variable name exists.

errorCount

const func integer: errorCount (in program: aProgram)

Determine the number of errors in aProgram.

Returns:
the number of errors.

globalObjects

const func ref_list: globalObjects (in program: aProgram)

Determine the list of global defined objects in aProgram. The returned list contains constant and variable objects in the same order as the definitions of the source program. Literal objects and local objects are not part of this list.

Returns:
the list of global defined objects.

syobject

const func reference: syobject (in program: aProgram, in string: name)

Determine object with name from program aProgram.

Returns:
a reference to the object or NIL if no object name exists.
Raises:
MEMORY_ERROR - If name cannot be converted to the internal representation.

match

const func reference: match (in program: aProgram, in ref_list: expression)

Determine object from program aProgram which matches expression.

Returns:
object from program.

isTemp

const func boolean: isTemp (in reference: aReference)

Determine if the referenced object is temporary.

Returns:
TRUE if aReference is temporary, FALSE otherwise.
Raises:
RANGE_ERROR - If aReference is NIL.

isVar

const func boolean: isVar (in reference: aReference)

Determine if the referenced object is variable.

Returns:
TRUE if aReference is a variable, FALSE otherwise.
Raises:
RANGE_ERROR - If aReference is NIL.

setVar

const proc: setVar (in reference: aReference, in boolean: isVariable)

Set var flag of a referenced object.

Raises:
RANGE_ERROR - If aReference is NIL.

category

const func category: category (in reference: aReference)

Get the category of a referenced object.

Returns:
the category of the referenced object.
Raises:
RANGE_ERROR - If aReference is NIL.

setCategory

const proc: setCategory (in reference: aReference, in category: aCategory)

Set the category of aReference to aCategory.

Raises:
RANGE_ERROR - If aReference is NIL.

formalParams

const func ref_list: formalParams (in reference: funcRef)

Get the formal parameters of the function referenced by funcRef. For objects without parameters an empty list is returned.

Returns:
the formal parameters as ref_list.
Raises:
RANGE_ERROR - If funcRef is NIL.
MEMORY_ERROR - An out of memory situation occurred.

setFormalParams

const proc: setFormalParams (in reference: funcRef, in ref_list: params)

Set the formal parameters of funcRef to params.

Raises:
RANGE_ERROR - If funcRef is NIL.
MEMORY_ERROR - An out of memory situation occurred.

resultVar

const func reference: resultVar (in reference: funcRef)

Gets the result variable of funcRef.

Returns:
a reference to the result variable.
Raises:
RANGE_ERROR - If funcRef is NIL or category(funcRef) <> BLOCKOBJECT holds.

resultInitValue

const func reference: resultInitValue (in reference: funcRef)

Gets the initialization value of the result variable of funcRef.

Returns:
a reference to the initialization value.
Raises:
RANGE_ERROR - If funcRef is NIL or category(funcRef) <> BLOCKOBJECT holds.

localConsts

const func ref_list: localConsts (in reference: funcRef)

Gets the local constants of funcRef.

Returns:
the local constants as ref_list.
Raises:
RANGE_ERROR - If funcRef is NIL or category(funcRef) <> BLOCKOBJECT holds.
MEMORY_ERROR - An out of memory situation occurred.

localVars

const func ref_list: localVars (in reference: funcRef)

Gets the local variables of funcRef.

Returns:
the local variables as ref_list.
Raises:
RANGE_ERROR - If funcRef is NIL or category(funcRef) <> BLOCKOBJECT holds.
MEMORY_ERROR - An out of memory situation occurred.

body

const func reference: body (in reference: funcRef)

Gets the body of the function referenced by funcRef.

Returns:
the body expression of funcRef.
Raises:
RANGE_ERROR - If funcRef is NIL or category(funcRef) <> BLOCKOBJECT holds.

arrayMinIdx

const func integer: arrayMinIdx (in reference: arrayRef)

Obtain the minimum index of the array referenced by 'arrayRef'.

Parameters:
arrayRef - Reference to an array object.
Returns:
the minimum index of the array.
Raises:
RANGE_ERROR - If 'arrayRef' does not refer to an array.

arrayMaxIdx

const func integer: arrayMaxIdx (in reference: arrayRef)

Obtain the maximum index of the array referenced by 'arrayRef'.

Parameters:
arrayRef - Reference to an array object.
Returns:
the maximum index of the array.
Raises:
RANGE_ERROR - If 'arrayRef' does not refer to an array.

arrayLength

const func integer: arrayLength (in reference: arrayRef)

Obtain the length of the array referenced by 'arrayRef'.

Parameters:
arrayRef - Reference to an array object.
Returns:
the length of the array.
Raises:
RANGE_ERROR - If 'arrayRef' does not refer to an array.

file

const func string: file (in reference: aReference)

Determine the file name of a referenced object.

Returns:
the file name of the referenced object.
Raises:
RANGE_ERROR - If aReference is NIL.
MEMORY_ERROR - Not enough memory to represent the result.

line

const func integer: line (in reference: aReference)

Determine the line number of a referenced object.

Returns:
the line number of the referenced object.
Raises:
RANGE_ERROR - If aReference is NIL.

objNumber

const func integer: objNumber (in reference: aReference)

Delivers an unique number for each object

Returns:
a unique object number.
Raises:
MEMORY_ERROR - Not enough memory to maintain the object table.


 previous   up   next