Class TypeParser


  • public class TypeParser
    extends Object
    A simple parser which can be used to read type definition units using the following syntax:
    unit := compounds

    compounds := { compound }

    compound := compound-name { members } [;]

    members := { member }

    member := type member-name ;

    type := scalar-type | array-type

    array-type := element-type [element-count] { [element-count] }

    element-type := scalar-type

    element-count := integer | member-reference

    scalar-type := simple-type | compound-name

    simple-type := byte | ubyte | short | ushort | int | uint | long | float | double

    member-reference := $member-name (member must be an integer type)

    compound-name := name

    member-name := name

    name := java-identifier | any character sequence within two enclosing " (double quote)

    For example:
     Dataset {
         int lineCount;
         Scanline[$lineCount] scanlines;
     };
     Scanline {
         int flags;
         double[512] data;
     };