BNF description of GRP language

GRP language is used internaly by GRED (Graphical Program Editor) . GRED saves every informations about developed program in a text file using GRP language. This file is called 'GRP file'. The GRP file contains informations about: The grapnel compiler reads the GRP file and generates C-source of the program. In this document we use bnf rules to describe the GRP language.

Note:

Application

GRPfile::= AppList.

AppList::= Application | AppList Application.

Application::= "APPLICATION" ":" ID "{" AppPartList "}".

AppPartList::= AppPart | AppPartList AppPart.

AppPart::= HeaderPart | ProgramPart | ScreenPart.

When Grapnel Compiler generates C source of the application it uses 'ID' from 'Application' rule as name of the source file of the application server program. It means that the 'ID' must be a valid file name. There are some examples here.

Header part

HeaderPart::= "HEADERPART" "{" HeaderSList "}".

HeaderSList::= | HedaerSList HeaderSection.

HeaderSection::= "SECTION" ":" SectionName "{" GroupList "}".

SectionName::= "EDITOR" | "MAPPING" | "DEBUG" | "MONITOR" | "HARDWARE".

GroupList::= | GroupList Group.

Group::= "GROUP" ":" ID "{" ParamList "}".

ParamList::= | ParamList Param.

Param::= ID "=" ParamValueList ";".

ParamValueList::= ParamValue.
ParamValueList::= ParamValueList "," ParamValue.

ParamValue::= IntNumber | FloatNumber | StringParam.

The header part of the GRP file contains additional informations required by the GRED (Graphical Editor), debugging and monitoring tools and so on. Parameters defined here can modify the generated source codes. It is not defined yet that what kind of 'ID' can appear in 'Group' rule. Possible 'ID' values in 'Param' rule are also undefined. It means that the Grapnel Compiler skips these parameters. See some examples.

Program part

ProgramPart::= "PROGRAMPART" "{" ProgramSList "}".

ProgramSList::= | ProgramSList ProgramSection.

Process::= "PROCESS" ProcessNumID ":" ID ProcessRank "HEADERSECTION" "{" ProcHgroupList "}" "PORTSECTION" "{" ProcSgroupList "}" "PROGRAMSECTION" "{" ProcPgroupList "}".

ProcessRank::= | "RANK" "=" IntNumber.

ProgramSection::= Process | ProcessGroup.

ProcessGroup::= ProcGroupType ProcessNumID ":" ID "{" "PORTSECTION" "{" ProcSgroupList "}" ProgramSList "}".

ProcessNumID::= | IntNumber.

ProcGroupType::= "PROCGROUP" | "FARM".

ProcHgroupList::= | ProcHgroupList ProcHgroup.

ProcHgroup::= PhgName CSuorce.

PhgName::= "GLOBAL" | "LOCAL" | "HEADS".

ProcSgroupList::= | ProcSgroupList ProcSgroup.

ProcSgroup::= PortType "(" Calculation ")" ":" IntNumber PortDefToPort.

PortType::= "INPORT" | "OUTPORT" | "INOUTPORT" | "MULTICAST" | "SCATTER" | "REDUCE" | "GATHER".

Calculation::= "NONE" | "SUM" | "PROD" | "AVG".

PortDefToPort::= | "{" "PROC" ":" PortDefToProcID ";" "PORTID" ":" PortDefToPortID ";" TypeList "}".

PortDefToProcID::= | ID | IntNumber.

PortDefToPortID::= | IntNumber.

TypeList::= | TypeList PortDataType.

PortDataType::= "TYPE" DataTypeDef ";".

DataTypeDef::= | DataType | DataType "[" DataTypeNum "]".

DataTypeNum::= IntNumber | CSource.

Datatype::= "CHAR" | "INT" | "FLOAT" | "DOUBLE" | ID.

ProcPgroupList::= | ProcPgroupList ProgItem.

ProgItem::= ProgItemType ":" IntNumber StringParam "{" ParamsOfPrgItem "}" PrgItemSource.

PrgItemSource::= | PrgItemSource CSource.

ProgItemType::= "SEQ" | "CAI" | "CAO" | "CAIALT" | "IFB" | "IFE" | "SWITCHB" | "SWITCHE" | "LOOPB" | "LOOPE" | "GRAPHIC" | "DUMMYB" | "DUMMYE".

ParamsOfPrgItem::= ItemOptionList ConnList PortParamList ItemListOfGraph.

ItemOptionList::= | ItemOptionList ItemOption.

ConnList::= Connection | ConnList Connection.

PortParamList::= | PortParamList PortParam.

ItemListOfGraph::= ProcPgroupList.

ItemOption::= "BLOCKED" | "UNBLOCKED" | ItemGuard.

ItemGuard::= "GUARD" "=" CSource.

Connection::= ConnectionType IntNumber ":" "{" ConnectionTo "}" ConnectionSource.

ConnectionType::= "CIN" | "COUT".

ConnectionTo::= IntNumber.

ConnectionSource::= | CSource.

PortParam::= "PORT" IntNumber ":" PortGuard PortSourceList.

PortGuard::= | "GUARD" "=" CSource.

PortSourceList::= | PortSourceList PortSource ";".

PortSource::= | CSource.

The program part of the application defines processes. It can split into three sections. Header section defines include files. Port section defines connections to other processes. Program section defines code of the processes. This is the most important section because it contains the structure of the program and source code of the sequential parts of the processes. There are examples here.

Screen part

ScreenPart::= "SCREENPART" "{" ScreenSList "}".

ScreenSList::= | ScreenSList ScreenSection.

ScreenSection::= "WINDOW" ":" ID "{" GroupList "}".

Miscellanous

ID::= (letter or "_") any character but whitespace.

Digit::= "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9".

DigitList::= Digit | DigitList Digit.

Sign:= | "+" | "-".

Hex:= | "0x" | "0X".

IntNumber::= Sign Hex DigitList.

FloatNumber::= Sign DigitList "." DigitList.
FloatNumber::= Sign DigitList "E" Sign DigitList.

StringParam::= """ CharList """.

CharList::= | CharList Char.

Char:= any character.

CSource::= "{@" any C-source code "}".
CSource::= StringParam


If you have any comment or idea send me an e-mail, please. My address is drdani@mazsola.iit.uni-miskolc.hu.

Back to Grapnel Compiler.