5.1.1.3 Comments

Comments begin with the character ‘;’ and continue until the end of line. Comments must adhere to certain rules for their correct identification and assignment to commented entities. If a comment occupies multiple lines, the character ‘;’ starting each comment line should be (approximately) at the same column. A commented entity can be:

An assembler instruction can have a comment above the instruction and a comment to the right of the instruction.

A comment above an assembler instruction should start at a column where an instruction name starts.

Example:

        ; Beginning of a PCFG production.
        ;
        ; The first argument is a nonterminal symbol at the
        ; left-hand side. The second argument is the index
        ; of a production right-hand side for the nonterminal
        ; symbol at the left-hand side.

        prod    "S", 1

A comment to the right of an assembler instruction begins to the right of a line of instruction parameters or a line just beneath them and can continue on the next lines and beyond the last instruction line.

Examples:

        rd      "E", 1,  ; spur update
                0, 3     ; [ "a" "b" ]
                         ; [^ "c" ]
                         ; [ "b" "c" "d" ]

        rd      "Long_nonterminal_symbol_name",
                1, 0, 3  ; spur update
                         ; [ "a" "b" ]
                         ; [^ "c" ]
                         ; [ "b" "c" "d" ]

        call    long_procedure_name
                         ; call another node to process
                         ; a symbol subsequence

A comment at the beginning of a procedure should precede a line with the proc keyword and start at a column where the proc keyword starts.

Example:

        ; Consume a terminal symbol sequence for the nonterminal
        ; symbol `S' representing the entire parse unit

S       proc
        procedure content
S       end     proc

A comment at the end of a program begins after the last instruction of a plain assembler program or after the last procedure of a compound assembler program.

Examples:

        ret

        ; Control returns to a calling node or application if there
        ; was no calling node.

S       end     proc

        ; The end of a program
        ;
        ; Seeing this comment means that the program is complete.