• BNF notation for mumps / GT.M ?

    From Steve@21:1/5 to K.S. Bhaskar on Mon Jan 18 11:40:04 2021
    I'm interested in the grammar for M. The link below does not exist, but there is comparable content at https://docs.yottadb.com/ProgrammersGuide/commands.html#break

    Steve
    ---
    On Thursday, January 28, 2010 at 1:14:30 PM UTC-8, K.S. Bhaskar wrote:
    On Jan 28, 2:49 pm, r...@panix.com (Rod Dorman) wrote:
    In article <e732cc44-1c58-402e-81e5-e405c3067...@o28g2000yqh.googlegroups.com>,

    Eric <eric.ane...@gmail.com> wrote:
    On Jan 27, 2:54 pm, Zbyszek <zbign@na_serwerzeo2.pl> wrote:
    Is there any? I cannot find it with Google.

    AFAIK there is no BNF grammar for M. That would indeed help
    documenting the language a lot.

    I've got a 1975 copy of MDC Document# 1/9 MUMPS Transition Diagrams
    [KSB] At least for GT.M, the grammar is reasonably well documented in
    formal notation in the Programmers Guide. Go to http://fis-gtm.com
    then click on the User Documentation tab and then Programmers Guide.
    For example, the section on the Break command includes:
    B[REAK][:tvexpr] [expr[:tvexpr][,...]]
    Regards
    -- Bhaskar
    ks dot bhaskar at fisglobal dot com <-- send e-mail here

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet
  • From OldMster@21:1/5 to Steve on Mon Jan 18 13:51:39 2021
    https://docs.yottadb.com/ProgrammersGuide/commands.html#break

    On Monday, January 18, 2021 at 2:40:05 PM UTC-5, Steve wrote:
    I'm interested in the grammar for M. The link below does not exist, but there is comparable content at https://docs.yottadb.com/ProgrammersGuide/commands.html#break

    Steve
    ---
    On Thursday, January 28, 2010 at 1:14:30 PM UTC-8, K.S. Bhaskar wrote:
    On Jan 28, 2:49 pm, r...@panix.com (Rod Dorman) wrote:
    In article <e732cc44-1c58-402e-81e5-e405c3067...@o28g2000yqh.googlegroups.com>,

    Eric <eric.ane...@gmail.com> wrote:
    On Jan 27, 2:54 pm, Zbyszek <zbign@na_serwerzeo2.pl> wrote:
    Is there any? I cannot find it with Google.

    AFAIK there is no BNF grammar for M. That would indeed help
    documenting the language a lot.

    I've got a 1975 copy of MDC Document# 1/9 MUMPS Transition Diagrams
    [KSB] At least for GT.M, the grammar is reasonably well documented in formal notation in the Programmers Guide. Go to http://fis-gtm.com
    then click on the User Documentation tab and then Programmers Guide.
    For example, the section on the Break command includes:
    B[REAK][:tvexpr] [expr[:tvexpr][,...]]
    Regards
    -- Bhaskar
    ks dot bhaskar at fisglobal dot com <-- send e-mail here

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From winfried.bantel@e-ntwicklung.de@21:1/5 to Zbyszek on Wed Jan 20 09:36:23 2021
    Zbyszek schrieb am Mittwoch, 27. Januar 2010 um 20:54:55 UTC+1:
    Is there any? I cannot find it with Google.

    Z.

    First of all: M is a language based on indentation, like python. Indentation-languages are very difficult to handle
    in compiler-science because they are Chomsky-Type 0 or 1, i don't now exactly.

    If you want to write a parser you'll have to do a little trick based on the compiler-phases introduced by Aho Sehti Ullman, see https://www.tutorialspoint.com/compiler_design/compiler_design_phases_of_compiler.htm

    - The scanner maintains the indentation, he delivers indentation-changed-tokens to the parser instead of indentation-tokens

    Now (from parser's point of view) the token-stream is in fact Chomsky-Type-2 (context-free). The rest will do the symbol-table.
    But now this type-2-grammer is no more the original type-0-grammar. (Annotation: Same problem is markdown, you'll find nowhere a markdown-grammer, an if: let me know!)

    Next problem: In M each statement is a pair of
    - statement
    - argument (can be empty)
    and there may be name-conflicts which have to be maintained by the scanner too. Code like
    if if do:do do go:go go
    (do 1 is a statement, do 2 is a variable, do 3 is a label, analog the three go) is possible, this is never possible in python or i think in any other language.

    As a consequence: In my opinion a "normal" BNF / EBNF will not be possible.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)