MiniM. Saving time.

| About | Download | Tools | Knowledge Base | How to Buy |

MiniM Overview

Getting Started




Cache Tools

GT.M Tools

Knowledge Base




MiniM Knowledge Base | Oct 7, 2010

How to validate syntax of MUMPS line

For syntax validation of line of MUMPS commands MiniM Database Server implements special function $view("rou","s"). Third argument of function must be a line of MUMPS commands.

Function check third argument for syntac correctness as this line be a line of MUMPS commands and be a valid argument of the xecute command. Line cannot contain label, dots of argumentless do command and this argumentless do command.

If third argument does not contains any syntax error, function returns an empty string. Otherwise function returns string with syntax error and possible extended diagnostic error description. While function works, current process error's context and values of system variables $ecode and $zerror does not changes. For example:

USER>w $v("rou","s","s a=123")

USER>w $v("rou","s","s a=123aaa")
<SYNTAX> :SET: *s a=123aaa

To check syntax of selected command's arguments, for example argument of the set command, need to be used concatenation of string to check as an argument and command with one space. For example:

USER>s set="a=123"

USER>w $v("rou","s","s "_set)

MUMPS is a language with late binding, so existence of things are used in line does not checks at the syntax analysis. For example, function does not check existence of local variables, z-function, labels and routines implementation. But syntax analysis cannot find any syntax error.

Function to syntax checking check syntax validity only for current MiniM Database Server version. In particular, latest version can supply any other extended functions or language extensions, and function will check syntax for this MiniM version possibility.

Eugene Karataev

Copyright (C) Eugene Karataev
Info Support