Appendix A. Dialects and Extensions

The XGC Coral 66 compiler supports Official Definiton Coral 66 and the dialects offered by several other compilers. To select the dialect you may select each detail of that dialect, or you may select a profile that corresponds to the details.

For example, to select the SDL dialect, use the option -fsdl-profile.

The "Blandford Extensions" may be used to extend any dialect.

The following table gives the features that may be selected using a compile-time option.

Each compile time option should be prefixed with either -fpermit or -fno-permit as appropriate. For example, to prohibit binary numbers, use the option -fno-permit-binary-and-hex.

Example A-1. Source File with Extension Keywords


'begin'
   'integer' i := 'binary'(1010101010101010);
   'integer' j := 'octal'(125252);
   'integer' k := 'hex'(aaaa);
'end'

When we compiler the file b1.cor with the option -fno-permit-binary-and-hex, the keywords BINARY and HEX are flagged as illegal keywords.


$ m68k-coff-gcc -c --list b1.cor -fno-permit-binary-and-hex

XGC CORAL66 Compiler Version 1.7

Compiling: b1.cor (time stamp: 2001/10/27 18:23:35)

     1. 'begin'
     2.    'integer' i := 'binary'(1010101010101010);
                          |
        >>> error: Illegal keyword 'binary'

     3.    'integer' j := 'octal'(125252);
     4.    'integer' k := 'hex'(aaaa);
                          |
        >>> error: Illegal keyword 'hex'

     5. 'end'
2 errors, 0 warnings, 0 comments

Table A-1 lists all the extension options and their default values. Several additional options, not documented here, allow one of several option dialects to be set. The default dialect is the XGC dialect and is set by default, or by the compiler option -fxgc-profile.

Table A-1. Optional Language Extensions

Rest of Compiler OptionDescriptionDefault Value
-binary-and-hexAllow the keywords BINARY and HEX, to express numeric literals to bases 2 and 16.1
-byte-numbertypeAllow the keyword BYTE, used to declare single bytes and byte arrays. 1
-constant-declarationsAllow the keyword CONSTANT to declare a named number. 1
-doubleAllow the keyword DOUBLE in place of LONG FLOATING1
-enterAllow the ENTER keyword (the ENTER statement is ingored and included for compatibility with otehr compilers)1
-floating-fixedMap Coral fixed point number types to target floating point instead of target integer0
-xgc-code-statementsAllow XCC code statements1
-honeywell-commentsAllow special characters in column one to indicate a comment line or page throw0
-identAllow the Digital Coral IDENT statement1
-includeUse the INCLUDE statement to include source text from other files. This is in place of the LIBRARY statement. 1
-listAllow the LIST keyword (which is ignored).1
-long-numbertypesAllow LONG INTEGER, LONG FIXED and LONG FLOATING.1
-named-commonAllow common declaration to be named.1
-named-externalAllow external declarations to be named.1
-nonstrict-bracketed-commentAllow bracketed comment where the Official Declaration fobids it, but where it is syntactically acceptable, after THEN, ELSE and BEGIN. 1
-program-nameAllow a program to begin "CORAL PROGRAM Id". Note that the program name is ignored. 1
-rad50Allow the Digital Coral RAD50 command form.1
-relational-keywordsAllow the realational operators to be written as keywords EQ, NE, LT, GT, LE an GE. 1
-sdl-code-statementsPermit SDL format code statements. Note these are not fully supported. 0
-segment-nameAllow a program to begin with "SEGMENT Id". 1
-shift-operatorsAllow the shift operators SLL, SRL, SLA, SRA SLC, SRC. 1
-short-identifiersAllow identifers to be truncated at 12 characters. 1
-string-length-prefixPlace the length of a string in the first byte of the string. 0
-string-command-presetsAllow string literals to preset byte arrays.1
-testAllow the TEST keyword and the text options. 1
-titleAllow the TITLE keyword.1
-typed-anonymous-referenceAllow a form of anonymous reference where the result type is other than INTEGER. For exmaple, allow "FLOATING [addr]". 1
-underscores-in-identifiersAllow identifiers to contain underscore characters. 1
-unsigned-literalsAllow integer literals to extend up to maximum unsigned value of the type so that, for example, the value -1 can be written as HEX(FFFFFFFF). 1
-uppercase-keywords

Keywords are written in upper case and not between apostrophes.

0