This chapter presents a formal description of the commands and GPSS statements to be used with GPSS World. The first section contains the definitions of the elements of the language used in GPSS Statements the second contains the grammar for PLUS, the Programming Language Under Simulation, and the third a glossary of commonly used terms.
Null:== [ ]0,0
No entry. May be skipped.
Uppercase :==A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z
Capital letters A through Z.
Lowercase :== a | b | c | d | e | f | g | h | i | j | k | l | m | n | o | p | q | r | s | t | u | v | w | x | y | z
Lower case letters a through z.
Alphabetic :==Uppercase |Lowercase
Either capital or lower case letters.
Digit :== 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
Numerals 0 through 9.
Comma :== ,
The comma symbol.
Blank :== [ ]1,1
Blank. A space containing no printable character.
Delimiter :== ; | Comma | Blank
A semicolon, comma, or blank. Delimiters are used to define the end of a field.
NonnegInteger :== [Digit ]1,15
Number of between 1 and 15 digits, inclusively.
PosInteger :== [ 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 ]1,1 [Digit ]0,15
Number of between 1 and 15 digits, inclusively. First digit may not be 0.
Fraction :== .[Digit ]1,15
Decimal point followed by 1 to 15 digits inclusively.
Sign :== Null | + | -
A plus or minus sign. If omitted, plus is assumed.
Integer :== Sign NonnegInteger
An integer with an optional sign.
NonnegNumber :==[Null | NonnegInteger ]1,1 [nul | fraction ]1,1
A nonnegative number which may include a fractional part.
Exponent :==E Sign [Digit ]1,3
E and an optional sign followed by 1, 2, or 3 digits.
Number :==NonnegInteger [Exponent ]0,1
A nonnegative number with an optional fractional part and optional exponent.
SignedNumber :==Sign Number
A number which may be positive or negative, may have a fractional part, and may have an exponent. The sign need not be present.
Name :== Alphabetic [ _|Alphabetic | Digit ]1,250 - [ Keyword | SNA | EntitySNAclass ]
An underscore, alphabetic character, or digit occurring 1 to 250 times and excluding reserved keywords. A name cannot be a verb or a valid SNA or SNA class. Lower case letters are automatically converted to upper case.
StatementLabel :== Name
A statement label is a name used in the label field of a GPSS statement to give a name to a GPSS entity like a STORAGE or TABLE or to give a location name to a BLOCK.
ResultMatrixName :== Name
A Result Matrix Name is passed to the ANOVA procedure to identify a Matrix Entity with special properties.
AtomicSNA :== A1 | AC1 | C1 | M1 | PR | TG1 | XN1 | Z1
Atomic SNAs are System Numeric Attributes which do not need an entity specifier. For example, C1 is the relative system clock.
EntitySNAclass :==[BV | CA | CC | CH | CM | CT | F | FC | FI | FN | FR | FT | FV | GN | GT | LS | MB | MP | MX | N | P | PR | Q | QA | QC | QM | QT | QX | QZ | R | RN | S | SA | SC | SE | SF | SR | SM | ST | SV | TB | TC | TD | V | W | X]1,1
Entity SNAs must be followed by an entity specifier in order to build a valid SNA. The entity specifier is the name or number of the entity, or when preceded by [*], is the name or number of the parameter of the Active Transaction containing the entity number. SNA class MX is excluded since it must also contain row and column specifiers (see directmatrixSNA and indirectmatrixSNA below).
SimpleSNA :== EntitySNAclass [PosInteger | $Name ]1,1
A simple SNA is an entity SNA which does not use indirect addressing. The entity specifier must be a positive integer or a name preceded by [$]. SNA class MX is excluded since it must also contain row and column specifiers (see directmatrixSNA and indirectmatrixSNA below).
DirectMatrixSNA :==MX[PosInteger | $Name ]1,1 ([[P]0,1 Posinteger | [P$]0,1Name ]1,1,[[P]0,1 Posinteger [P$]0,1 Name]1,1)
The MX is followed by a matrix entity specifier followed, in parentheses, by a row specifier and a column specifier. The row and column specifiers are positive integers, names or P class SNAs, separated by a comma. Indirect addressing is described below. The [$] is used as a separator when referencing a parameter by name in a row or column specifier.
DirectSNA :==AtomicSNA | SimpleSNA | DirectMatrixSNA
A direct SNA is any SNA which doesn’t use indirect addressing.
IndirectMatrixSNA :==MX[[PosInteger | $Name | *[PosInteger | [$]0,1 Name ]1,1]1,1 ([[P]0,1 PosInteger | [P$]0,1 Name | *[PosInteger | [$]0,1 Name ]1,1 Comma [[P]0,1 PosInteger | [P$]0,1 Name | *[Posinteger | [$]0,1 Name]1,1)]1,1[DirectMatrixSNA]
The MX is followed by a matrix entity specifier followed, in parentheses, by a row specifier and a column specifier. The row and column specifiers are separated by a comma. At least one item must be specified using indirect addressing. If row and column specifiers are SNAs, they must be P class SNAs. A Setting is available for using the # character instead of the *.
SNA*Parameter :==[BV | CA | CC | CH | CM | CT | F | FC | FI | FN | FR | FT | FV | GN | GT | LS | MB | MP | MX | N | P | PR | Q | QA | QC | QM | QT | QX | QZ | R | RN | S | SA | SC | SE | SF | SR | SM | ST | SV | TB | TC | TD | V | W | X]1,1 *[PosInteger | [$]0,1 Name ]1,1
This is indirect addressing. The entity number is in a Transaction Parameter. The entity SNA class is followed by * followed by the name or number of a parameter of the Active Transaction containing the entity number. A Setting is available for using the # character instead of the *.
IndirectSNA :==SNA*Parameter | IndirectMatrixSNA
An SNA where the entity, row or column is specified by indirect addressing. A Setting is available for using the # character instead of the *.
MatrixSNA :==DirectMatrixSNA | IndirectMatrixSNA
Any MX class SNA.
SNA :==DirectSNA | IndirectSNA
Simpleterm :==Name | SNA | SignedNumber
Simplest items in an expression.
MathFunction :== ABS | ATN | COS | EXP | INT | LOG | RND | SIN | SQR | TAN
Mathematical routines in the math library. these may be used to build expressions.
A call to a math library subroutine with an expression as the argument.
BinaryOperator :== + | - | # | / | \ | ^
Addition, subtraction, multiplication, division, integer division, and exponentiation. The [*] symbol is reserved for indirect addressing. ]#] represents multiplication and ^ represents exponentiation.
BlockName :==ADOPT | ADVANCE | ALTER | ASSEMBLE | ASSIGN | BUFFER | CLOSE | COUNT | DEPART | DISPLACE | ENTER | EXAMINE | EXECUTE | FAVAIL | FUNAVAIL | GATE | GATHER | GENERATE | INDEX | INTEGRATION | JOIN | LEAVE | LINK | LOGIC | LOOP | OPEN | MARK | MATCH | MSAVEVALUE | OPEN | PLUS | PREEMPT | PRIORITY | QUEUE | READ | RELEASE | REMOVE | RETURN | SAVAIL | SAVEVALUE | SCAN | SEEK | SEIZE | SELECT | SPLIT | SUNAVAIL | TABULATE | TERMINATE | TEST | TRACE | TRANSFER | UNLINK | UNTRACE | WRITE
GPSS block names.
LogicSwitchOp :== I | R | S
The operators used in the operator field of LOGIC blocks: I (invert), R (reset), or S (set).
RelationalOp :== E | G | GE | L | LE | NE
The relational operators used in the operator field of certain GPSS blocks: E (equal), G (greater than), GE (greater than or equal to), L (less than), LE (less than or equal to), NE (not equal to).
ConditionalOp :== E | G | GE | L | LE | MAX | MIN | NE
The conditional operators used in the operator field of certain GPSS blocks: E (equal), G (greater than), GE (greater than or equal to), L (less than), LE (less than or equal to), MAX (maximum), MIN (minimum), NE (not equal to).
GateOp :== FNV | FV | I | LS | LR | M | NI | NM | NU | SE | SF | SNE | SNF | SNV | SV | U
The operators used in the operator field of GATE blocks.
The operators specify a test condition and an entity type. The operators
·FV Facility must be available.
·I Facility must be preempted.
·LS logicswitch must be set.
·LR logicswitch must be reset.
·M MATCH block must have a Transaction of the same assembly set
as the Active Transaction.
·NI Facility must not be currently preempted.
·NM MATCH block must NOT have a Transaction of the same as
sembly set as the Active Transaction.
·NU Facility must not be in use.
·SE Storage must be empty.
·SF Storage must be full.
·SNE Storage must be not empty.
·SNF Storage must be not full.
·SNV Storage must be not available.
·SV Storage must be available.
·U Facility must be in use.
LineNumber :== Number
CommandName :==BVARIABLE | CLEAR | CONDUCT | CONTINUE | EQU | EXIT | FUNCTION | FVARIABLE | HALT | INCLUDE | INITIAL | INTEGRATE | MATRIX | QTABLE | REPORT | RESET | RMULT | SHOW | START | STEP | STOP | STORAGE | TABLE | VARIABLE
GPSS Commands do not define block entities. They set the conditions of the simulation and define other GPSS entities.
Verb :== BlockName | CommandName
Statement specific syntax is discussed in Chapters 3, 6, 7, and 8.
Procedure:== PROCEDURE ProcedureName ( FormalArgumentList ) Statement
Experiment :== EXPERIMENT ProcedureName ( FormalArgumentList ) Statement
Statement := CompoundStatement | IfStatement | IfElseStatement | WhileStatement | AssignStatement | GotoStatement | ReturnStatement |ProcedureCallStatement|LabeledStatement | TempDeclarationStatement
LabeledStatement :== Label Statement
Label :== Name
TempDeclarationStatement :== TempVarDeclareStatement | TempMatrixDeclareStatement
TemporaryVarDeclareStatement :== TEMPORARY NameList ;
TempMatrixDeclareStatement :== TEMPORARY MATRIX Name[ IntegerList ] ;
CompoundStatement := BEGIN StatementSequence END ;
FormalArgumentList := Name [ , Name ] ... | NULL
StatementSequence := Statement [ Statement ] ... | NULL
AssignStatement := Lvalue = Expression ;
IfStatement := IF ( Expression ) THEN Statement
IF ( Expression ) THEN Statement ELSE Statement
WhileStatement: WHILE ( Expression ) DO Statement
GotoStatement := GOTO LabelName ;
ReturnStatement := RETURN [ Expression ] ;
ProcedureCallStatement := ProcedureCall ;
ProcedureCall := ProcedureName( ExpressionList )
ProcedureName := LibraryProcedureName | Name
FormalArgumentList := Name [ , Name ] ... | NULL
StatementSequence := Statement [ Statement ] ... | NULL
ExpressionList := Expression [ , Expression ] ...
ExperimentName := Name
ModelName := Name
StringConstant := " [Character ]..."
ParenthesizedExpression := ( Expression )
Expression := Expression | SuperResult
SuperResult := SuperResult & InterResult
InterResult := InterResult = SubResult
:= InterResult /= SubResult
SubResult := SubResult < Comparator
:= SubResult > Comparator
:= SubResult <= Comparator
:= SubResult >= Comparator
Comparator := Comparator + Term
:= Comparator - Term
Term := Term # Factor
:= Term / Factor
:= Term \ Factor
:= Term @ Factor
A Setting is available for using the * character instead of the #.
Factor := Factor ^ Factor
:= - Factor
:= + Factor
GenericDatum := Name
ArrayElement := Name [ ExpressionList ]
LValue := Name
:= Name [ ExpressionList ]
Active Transaction- That GPSS Transaction in a simulation which is at the Head of the Current Events Chain and is the next to attempt entry into a GPSS Block.
Command File - A Secondary Model File intended for interactive use. A Function Key loaded with an INCLUDE Statement can run a Control File with a single keystroke.
Data Stream - A sequence of text lines identified by a unique positive integer.
Entity Label - A Named Value used in the Label field of a GPSS Statement.
GPSS Statement - A GPSS Block Statement or a Command occurring in a single Text Line.
Immediate Command - A Command which when sent to a Simulation Object is performed immediately and is not placed on the Command Queue. HALT and SHOW are the only Immediate Commands. A HALT Command interrupts any running simulation and deletes all remaining Commands from the Command Queue.
Internal Model File Number - the 0-relative ordinal of the Model File in the order encountered by the Translator. The Model Object is assigned Model File Number 0.
Interactive Statement - A Model Statement sent to an existing simulation.
Manual Simulation Statement - an Interactive Block Statement, causing a temporary Block to be created, and causing the Active Transaction to attempt entry.
Model - A sequence of Model Statements.
Model File - A file containing Model Statements.
Model Statement - A GPSS Statement or a PLUS Procedure definition.
Named Value - A user created name used in a model.
PLUS Procedure - A PLUS PROCEDURE or EXPERIMENT Statement obeying the Syntax rules of the PLUS Language.
Primary Model File - A Model File brought into a Model Window of a GPSS World Session.
Queued Command - A Command which when sent to a Simulation Object is placed on a Command Queue behind all other Commands waiting to be performed. All Commands except HALT and SHOW are Queued Commands.
Secondary Model File - A Text Object Translated as a result of an INCLUDE Command.
Session - The Sequence of Events from the Opening to the Closing of the GPSS World process.
Simulation - The Result of Translation of a model, whose state can be advanced by a Simulation Object.
Statement - A GPSS Statement or a PLUS Statement.
String - A sequence of characters.
Termination Count - The state variable in each simulation that, when it becomes nonpositive, causes the simulation to end.
Text Line - A Sequence of up to 250 print characters, including blanks and tabs, terminated by, but not including, a CR LF sequence.
Trace Indicator - A Transaction state variable that causes a Trace Message to be created by each Block entry.
Translator - That part of the GPSS World Control Process which converts a model into a simulation.
User Variable - A Named Value not occurring in any GPSS Statement Label field.
[Table of Contents]