[Mumps2Py:] [68] implementation-specific cruft removal. |
[ Thread Index |
Date Index
| More lists.mumps2py.org/discuss Archives
]
Revision: 68
Author: pgallot
Date: 2008-01-30 23:45:40 +0000 (Wed, 30 Jan 2008)
Log Message:
-----------
implementation-specific cruft removal.
Modified Paths:
--------------
trunk/mumps2py/tokens.py
Modified: trunk/mumps2py/tokens.py
===================================================================
--- trunk/mumps2py/tokens.py 2008-01-30 23:31:22 UTC (rev 67)
+++ trunk/mumps2py/tokens.py 2008-01-30 23:45:40 UTC (rev 68)
@@ -27,13 +27,12 @@
HANGCMD, IFCMD, JOBCMD, KILLCMD = 9, 10, 11, 12
LOCKCMD, MERGECMD, NEWCMD, OPENCMD = 13, 14, 15, 16
QUITCMD, READCMD, SETCMD, USECMD = 17, 18, 19, 20
-VIEWCMD, WRITECMD, XECUTECMD, ZQUITCMD = 21, 22, 23, 24
-ZETRAPCMD, EXPR, LOCALVAR, GLOBALVAR = 25, 26, 27, 28
-INTRINSICVAR, INTRINSICFUNC, USERFUNC = 29, 30, 31
+VIEWCMD, WRITECMD, XECUTECMD = 21, 22, 23
+EXPR, LOCALVAR, GLOBALVAR, ENTRYREF = 26, 27, 28, 29
STRINGLITERAL, NUMLITERAL, INDIRECTION = 33, 34, 35
-UNKNOWNITEM, ENTRYREF = 36, 37
+UNKNOWNITEM, UNKNOWNCMD, USERFUNC = 36, 37, 38
FCC_NEWLINE, FCC_NEWPAGE, FCC_MOV, FCC_CHARVAL = 40, 41, 42, 43
-EMPTYLINE, ZWRITECMD = 45, 46
+EMPTYLINE, ZWRITECMD, ROUTINEHEAD, TEXTVAL = 45, 46, 47, 48
# NOTE: OPERATORS have token values starting at 50.
OPADD, OPSUB, OPMULT, OPEXP = 50, 51, 52, 53 # +,-,*, **
@@ -61,7 +60,7 @@
V_ZCSTATUS, V_ZVER, V_ZVERSION, V_ZERROR = 167, 168, 169, 170
# NOTE: I have no idea what these intrinsic vars are for:
V_ZJOB, V_ZR, V_ZNSPACE, V_ZH = 171, 172, 173, 174
-V_ZTRAP = 175
+V_ZTRAP, V_UNKNOWN = 175, 176
OP_TOKEN_DICT = {"+":OPADD, "-":OPSUB,
"*":OPMULT, "**":OPEXP,
@@ -78,7 +77,7 @@
"_":OPCONCAT}
-IntrinsicVarDict = {"D":V_DEVICE, "DEVICE":V_DEVICE,
+INTRINSIC_VARS = {"D":V_DEVICE, "DEVICE":V_DEVICE,
"EC":V_ECODE, "ECODE":V_ECODE,
"ES":V_ESTACK, "ESTACK":V_ESTACK,
"ET":V_ETRAP, "ETRAP":V_ETRAP,
@@ -94,18 +93,9 @@
"SY":V_SYSTEM, "SYSTEM":V_SYSTEM,
"T": V_TEST, "TEST":V_TEST,
"X":V_X,
- "Y":V_Y,
- "ZC":V_ZCSTATUS, "ZCSTATUS":V_ZCSTATUS,
- "ZE":V_ZERROR, "ZERROR":V_ZERROR,
- "ZJ":V_ZJOB, "ZJOB": V_ZJOB,
- "ZVER":V_ZVER,
- "ZR":V_ZR,
- "ZNSPACE":V_ZNSPACE,
- "ZH":V_ZH,
- "ZT":V_ZTRAP, "ZTRAP":V_ZTRAP,
- "ZV":V_ZVERSION, "ZVERSION":V_ZVERSION}
+ "Y":V_Y}
-IntrinsicFuncDict = {"A":F_ASCII, "ASCII":F_ASCII,
+INTRINSIC_FUNCS = {"A":F_ASCII, "ASCII":F_ASCII,
"C":F_CHAR, "CHAR":F_CHAR,
"D":F_DATA, "DATA":F_DATA,
"E":F_EXTRACT, "EXTRACT":F_EXTRACT,
@@ -126,12 +116,7 @@
"ST":F_STACK, "STACK":F_STACK,
"T":F_TEXT, "TEXT":F_TEXT,
"TR":F_TRANSLATE, "TRANSLATE":F_TRANSLATE,
- "V":F_VIEW, "VIEW":F_VIEW,
- "ZB":F_UNKNOWN,
- "ZC":F_UNKNOWN,
- "ZCONVERT":F_UNKNOWN,
- "ZU":F_UNKNOWN,
- "ZJOB":F_UNKNOWN}
+ "V":F_VIEW, "VIEW":F_VIEW}
CMD_TOKEN_DICT = {"B":BREAKCMD, "BREAK":BREAKCMD,
"C":CLOSECMD, "CLOSE":CLOSECMD,
@@ -154,9 +139,7 @@
"V":VIEWCMD, "VIEW":VIEWCMD,
"W":WRITECMD, "WRITE":WRITECMD,
"X":XECUTECMD, "XECUTE":XECUTECMD,
- "ZQ":ZQUITCMD, "ZQUIT":ZQUITCMD,
"ZWR":ZWRITECMD, "ZWRITE":ZWRITECMD,
- "ZETRAP":ZETRAPCMD, # not sure what this is exactly...
";":COMMENT}
TOKEN_REVERSE_DICT = {
@@ -177,15 +160,7 @@
V_TEST:"$TEST",
V_X:"$X",
V_Y:"$Y",
- V_ZCSTATUS:"$ZCSTATUS",
- V_ZERROR:"$ZERROR",
- V_ZJOB:"$ZJOB",
- V_ZVER:"Unknown Intrinsic variable",
- V_ZR:"Unknown Intrinsic variable",
- V_ZNSPACE:"Unknown Intrinsic variable",
- V_ZH:"Unknown Intrinsic variable",
- V_ZTRAP:"$ZTRAP",
- V_ZVERSION:"$ZVERSION",
+ V_UNKNOWN:"Unknown intrinsic variable",
F_ASCII:"$ASCII",
F_CHAR:"$CHAR",
F_DATA:"$DATA",
@@ -258,13 +233,10 @@
WRITECMD:"WRITE",
XECUTECMD:"XECUTE",
ZWRITECMD:"ZWRITE",
- ZQUITCMD:"Unknown command",
- ZETRAPCMD:"Unknown command",
+ UNKNOWNCMD:"Unknown command",
EXPR:"Expression",
LOCALVAR:"Local Variable",
GLOBALVAR:"Global Variable",
- INTRINSICVAR:"Intrinsic Variable",
- INTRINSICFUNC:"Intrinsic Function",
USERFUNC:"User Function",
STRINGLITERAL:"String",
NUMLITERAL:"Number",
@@ -272,11 +244,12 @@
UNKNOWNITEM:"Unknown Item",
ENTRYREF:"Entryref",
LOCALVAR:"Local Var",
- EMPTYLINE:"",
- FCC_NEWLINE:"!",
- FCC_NEWPAGE:"#",
- FCC_MOV:"mov",
- FCC_CHARVAL:"asc",
+ EMPTYLINE:"empty line",
+ TEXTVAL:"$TEXT val",
+ FCC_NEWLINE:"<LF>",
+ FCC_NEWPAGE:"<FF>",
+ FCC_MOV:"<mov>",
+ FCC_CHARVAL:"<asc>",
}
def extract_subtokens(extract_dict, extract_types, token):