Examples about header part of GRP files

Example #1: empty lists

.
.
HeaderPart {}

HeaderPart
{
  Section: editor
  {
    Group: First_Group {}
    Group: Second_Group
    {
      Parameter1= 1;
    }
  }
}
.
.
This example shows that header part can be empty and parameter list of groups can be so.


Example #2: integer and float parameters

.
.
HeaderPart
{
  Section: mapping
  {
    Group: OneGroup
    {
       Param1= 123;
       Param2= -12.23;
       Param3= 12e-34;
       Param4= 12e34;
       Param5= -43E7678;
       Param6= +65E-56;
       Param7= -76e-89;
    }
  }
}
.
.
This example defines some parameters in 'OneGroup'. First parameter is an integer number and the following ones are real numbers. GRP file can define character string parameters as well, see next example how.


Example #3: character string parameters

.
.
HeaderPart
{
  Section: monitor
  {
    Group: Yo
      {
        Param1= "Text.";
        Param2= "There is a quote in the text: \" that was...\" ";
        Param3=

"This will be a multiline text...\
\
this text is in a new line...\
an additional line...\
at least the last line. \
These lines will be concatenated by the Grapnel Compiler!\
";

        Param4=

"Escape sequences recognized by the Grapnel Compiler:\n\n\
New line       (\\n): \n\n\
Tabulator      (\\t): from >\t<to\n\
Backspace      (\\b): after >:\b was a >: colon...\n\
Carrige return (\\r): from\rto\n\
Form feed      (\\f): from\fto\n\
Others    (eg: \\\\): character literally \\.\n\
That's all!\
";
      }
  }
}
.
.
This example demonstrates character string parameters. If text is long, we can split the text into several lines. In that case a backslash (\) must be used at the and of the lines. Grapnel compiler will concatenate these lines. We can put most of standard C escape sequences into texts. One of exeptions is octal character code after \.


Example #4: parameters with multi-type values

.
.
HeaderPart
{
  Section: editor
  {
    Group: GroupOfParams
    {
      Par0= "text 1", "text 2";
      Par1= 1, 2.3, "3rd value";
      Par2= 12, 23, "text value", 3e-2, 4.1;
    }
  }
}
.
.
This example demonstrates, that it is possible to assign more than one value to any parameter. Types of values can be same as in Par0 or their types can be different as in Par1 and Par2.


Examples about applications.
Examples about program part.

Back to definition of GRP language.
Back to Grapnel Compiler.