Define <LINE-START> and <LINE-END> in the lexer

I am trying to implement a front end that is trying to fit a subset of this specification .

It seems that many things are clearly defined in the link, except <LINE-START>and <LINE-END>which are nonetheless often used.

Here is a quote: "For the convenience of the specification, it is convenient to be able to explicitly refer to a point that immediately precedes the beginning of a logical line and a point immediately preceding the final terminator of lines of a logical line. It is performed using <LINE-START>and <LINE-END>as terminal characters of VBA grammars. A <LINE-START>is defined as immediately preceding each logical line, and is <LINE-END>defined as a replacement <line-terminator>at the end of each logical line: "

Here are some examples:

line-terminator = (%x000D %x000A) / %x000D / %x000A / %x2028 / %x2029
line-continuation = *WSC underscore *WSC line-terminator
WS = 1*(WSC / line-continuation)

EOL = [WS] LINE-END
logical-line = LINE-START *extended-line LINE-END

if-statement = LINE-START "If" boolean-expression "Then" EOL
               statement-block
               *[else-if-block]
               [else-block]
               LINE-START (("End" "If") / "EndIf")

else-if-block = LINE-START "ElseIf" boolean-expression "Then" EOL
                LINE-START statement-block

else-block = LINE-START "Else" statement-block

Does anyone know where and how to identify <LINE-START>and <LINE-END>?

+5
source share
2 answers

, , , 3.2.2. , ( ) . , .

. BOF/EOF. , , . , . - ; , , , . (, Start Line - , , , EOF). () .

, ?/? , . .

+1

VBA

Dim from
Dim to
FakeTest from, to

LINE-START , , .

, LINE-END , , .

, VBA , , :

CallMethod param1, param2, _
           param3

VBA , , , :

result = CallAMethod(param1, param2)

, .

I say: spaces and tabs are part of the language syntax. This does not apply to other programming languages.

0
source

All Articles