Microsoft Small Basic

Program Listing: XRZ138
' 2012/10/18 12:51:09 Code generated by Small Basic Parser Generator 0.4

version = "0.4"
SBGI_Main()

Sub SBGI_Main
' Small Basic Graphics Interpreter | Main
title = "Small Basic Graphics Interpreter " + version
traceC = "False" ' trace subroutine call
traceX = "False" ' trace operation execution
traceV = "False" ' dump variable array after parse
TextWindow.Title = title
GraphicsWindow.Left = 0
TextWindow.Left = Desktop.Width - 680
Lex_Init()
TextWindow.WriteLine("Enter statements (Graphics operations) below.")
TextWindow.WriteLine("")
While "True"
buf = TextWindow.Read()
TextWindow.ForegroundColor = "Green"
len = Text.GetLength(buf)
ptr = 1
Parse_State()
If ptr <= len Then
TextWindow.WriteLine("Syntax Error")
EndIf
If traceV Then
TextWindow.WriteLine("var=" + WQ + var + WQ)
EndIf
TextWindow.ForegroundColor = "Gray"
EndWhile
EndSub

Sub Exec_Expr
' Excecution | Expression
' expr ::= [[]{+|-}[]]
If match Then
If traceX Then
TextWindow.Write("Expr:_opt=" + WQ + _opt + WQ + ",_val=" + WQ + _val + WQ)
EndIf
If _opt[1] = "+" Then ' array
val = _val[1] + _val[2]
ElseIf _opt[1] = "-" Then
val = _val[1] - _val[2]
ElseIf _opt[1] = "" Then
val = _val[1]
EndIf
If traceX Then
TextWindow.WriteLine(",val=" + WQ + val + WQ)
EndIf
EndIf
EndSub

Sub Exec_Factor
' Excecution | Factor
' factor ::= {|([][])}
If match Then
If traceX Then
TextWindow.Write("Factor:_val=" + WQ + _val + WQ)
EndIf
If _opt[1] = "val" Then
val = _val[1]
ElseIf _opt[1] = ")" Then
val = _val[2]
EndIf
If traceX Then
TextWindow.WriteLine(",val=" + WQ + val + WQ)
EndIf
EndIf
EndSub

Sub Exec_Let
' Excecution | Let
' let ::= {|}[]=[]
If match Then
If traceX Then
TextWindow.WriteLine("Let:_opt=" + WQ + _opt + WQ + ",_val=" + WQ + _val + WQ)
EndIf
If _opt[1] = "_var" Then
var[name] = val
If traceX Then
TextWindow.WriteLine("! " + name + "=" + val)
EndIf
ElseIf _opt[1] = "prop" Then
If prop = "bg" Then
GraphicsWindow.BackgroundColor = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.BackgroundColor=" + val)
EndIf
ElseIf prop = "bc" Then
GraphicsWindow.BrushColor = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.BrushColor=" + val)
EndIf
ElseIf prop = "fb" Then
GraphicsWindow.FontBold = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.FontBold=" + val)
EndIf
ElseIf prop = "fi" Then
GraphicsWindow.FontItalic = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.FontItalic=" + val)
EndIf
ElseIf prop = "fn" Then
GraphicsWindow.FontName = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.FontName=" + val)
EndIf
ElseIf prop = "fs" Then
GraphicsWindow.FontBold = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.FontSize=" + val)
EndIf
ElseIf prop = "hi" Then
GraphicsWindow.Height = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.Height=" + val)
EndIf
ElseIf prop = "le" Then
GraphicsWindow.Left = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.Left=" + val)
EndIf
ElseIf prop = "pc" Then
GraphicsWindow.PenColor = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.PenColor=" + val)
EndIf
ElseIf prop = "pw" Then
GraphicsWindow.PenWidth = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.PenWidth=" + val)
EndIf
ElseIf prop = "ti" Then
GraphicsWindow.Title = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.Title=" + val)
EndIf
ElseIf prop = "to" Then
GraphicsWindow.Top = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.Top=" + val)
EndIf
ElseIf prop = "wi" Then
GraphicsWindow.Width = val
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.Width=" + val)
EndIf
EndIf
EndIf ' _opt[1]
If traceX Then
TextWindow.WriteLine("Let:val=" + WQ + val + WQ)
EndIf
EndIf ' match
EndSub

Sub Exec_Literal
' Excecution | Literal
' literal ::= {|<_str>}
If match Then
If traceX Then
TextWindow.Write("Literal:_opt=" + WQ + _opt + WQ + ",_val=" + WQ + _val + WQ)
EndIf
If _opt[1] = "real" Then
val = _val[1]
ElseIf _opt[1] = "_str" Then
val = _val[2]
EndIf
If traceX Then
TextWindow.WriteLine(",val=" + WQ + val + WQ)
EndIf
EndIf
EndSub

Sub Exec_Real
' Excecution | Real
' real ::= [-]<_num>[.<_num>]
If match Then
If traceX Then
TextWindow.Write("Real:_const=" + WQ + _const + WQ + ",_val=" + WQ + _val + WQ)
EndIf
val = _const[1] + _val[1] ' sign + int
If _const[2] = "." Then
val = Text.Append(val + ".", _val[2]) ' sign + int + "." + frac
EndIf
If traceX Then
TextWindow.WriteLine(",val=" + WQ + val + WQ)
EndIf
EndIf
EndSub

Sub Exec_Term
' Excecution | Term
' term ::= [[]{'*'|/}[]]
If match Then
If traceX Then
TextWindow.Write("Term:_opt=" + WQ + _opt + WQ + ",_val=" + WQ + _val + WQ)
EndIf
If _opt[1] = "*" Then ' array
val = _val[1] * _val[2]
ElseIf _opt[1] = "/" Then
val = _val[1] / _val[2]
ElseIf _opt[1] = "" Then
val = _val[1]
EndIf
If traceX Then
TextWindow.WriteLine(",val=" + WQ + val + WQ)
EndIf
EndIf
EndSub

Sub Lex_Init
UPPER = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
LOWER = "abcdefghijklmnopqrstuvwxyz"
DIGIT = "0123456789"
FCHAR = UPPER + LOWER ' first charcters for label/variable/sub
TCHAR = FCHAR + DIGIT + "_" ' trailing characters for label/variable/sub
WQ = Text.GetCharacter(34) ' double quote
SQ = "'" ' single quote
CRLF = Text.GetCharacter(13) + Text.GetCharacter(10) ' carriage return + line feed
EndSub

Sub Lex_Label
' param buf - buffer
' param ptr - pointer
' return match - "True" if match
' return ptr - next pointer
' return label[] - label name array
' return val - label name
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
Lex_Name()
If match And (Array.ContainsValue(label, val) = "False") Then
nLabel = nLabel + 1
label[nLabel] = val
EndIf
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Lex_Name
' param buf - buffer
' param ptr - pointer
' return match - "True" if match
' return ptr - next pointer
' return name - name
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
ch = Text.GetSubText(buf, ptr, 1)
If Text.GetIndexOf(FCHAR, ch) > 0 Then
name = ch
ptr = ptr + 1
match = "True"
While match
ch = Text.GetSubText(buf, ptr, 1)
If Text.GetIndexOf(TCHAR, ch) > 0 Then
ptr = ptr + 1
name = name + ch
Else
match = "False"
EndIf
EndWhile
match = "True"
Else
name = ""
match = "False"
EndIf
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Lex_Num
' param buf - buffer
' param ptr - pointer
' return match - "True"
' return ptr - next pointer
' return val - number
ch = Text.GetSubText(buf, ptr, 1)
If Text.GetIndexOf(DIGIT, ch) > 0 Then
val = ch
ptr = ptr + 1
match = "True"
While match
ch = Text.GetSubText(buf, ptr, 1)
If Text.GetIndexOf(DIGIT, ch) > 0 Then
ptr = ptr + 1
val = Text.Append(val, ch)
Else
match = "False"
EndIf
EndWhile
match = "True"
Else
val = ""
match = "False"
EndIf
EndSub

Sub Lex_Space0
' param buf - buffer
' param ptr - pointer
' return match - "True"
' return ptr - next pointer
txt = " "
match = "True"
While match
Lex_Text()
EndWhile
match = "True"
EndSub

Sub Lex_Space1
' param buf - buffer
' param ptr - pointer
' return match - "True"
' return ptr - next pointer
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
txt = " "
Lex_Text()
If match Then
While match
Lex_Text()
EndWhile
match = "True"
Else
TextWindow.WriteLine("Syntax Error: space not found")
EndIf
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub



Sub Lex_Str
' param buf - buffer
' param ptr - pointer
' return match - "True"
' return ptr - next pointer
' return val - string
Stack.PushValue("local", ptr)
txt = WQ
Lex_Text()
If match Then
ch = Text.GetSubText(buf, ptr, 1)
str = ""
While ch <> WQ
str = str + ch
ptr = ptr + 1
ch = Text.GetSubText(buf, ptr, 1)
EndWhile
EndIf
If match Then
txt = WQ
Lex_Text()
EndIf
_ptr = Stack.PopValue("local")
If match Then
val = str
Else
val = ""
ptr = _ptr
EndIf
EndSub

Sub Lex_Text
' param buf - buffer
' param ptr - pointer
' param txt - text to lexical analysis
' return match - "True" if match
' return ptr - next pointer
' return val - txt if match
If traceC Then
If txt = CRLF Then
_txt = "CRLF"
ElseIf txt = WQ Then
_txt = SQ + txt + SQ
Else
_txt = WQ + txt + WQ
EndIf
TextWindow.WriteLine(" " + ptr)
EndIf
val = ""
txtlen = Text.GetLength(txt)
lotxt = Text.ConvertToLowerCase(txt)
lobuf = Text.ConvertToLowerCase(Text.GetSubText(buf, ptr, txtlen))
If lobuf = lotxt Then
match = "True"
ptr = ptr + txtlen
val = txt
Else
match = "False"
EndIf
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Lex_Var
' _var ::= <_name>['['[][]']'['['[][]']']]
' param buf - buffer
' param ptr - pointer
' return match - "True" if match
' return ptr - next pointer
' return var[] - variable name array
' return name - variable name
' return val - variable
Stack.PushValue("local", _val)
_val = ""
Lex_Name()
_val[1] = val
Stack.PushValue("local", name)
If match Then
Stack.PushValue("ptr",ptr)
If match Then
txt = "["
Lex_Text()
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = "]"
Lex_Text()
EndIf
If match Then
Stack.PushValue("ptr",ptr)
If match Then
txt = "["
Lex_Text()
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = "]"
Lex_Text()
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
match = "True"
EndIf
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
match = "True"
EndIf
EndIf
name = Stack.PopValue("local")
If match Then
If _val[3] <> "" Then
name = name + "[" + _val[2] + "][" + _val[3] + "]"
ElseIf _Val[2] <> "" Then
name = name + "[" + _val[2] + "]
EndIf
If Array.ContainsIndex(var, name) Then
val = var[name]
If val = "N/A" Then
val = ""
EndIf
Else
var[name] = "N/A"
val = ""
EndIf
EndIf
_val = Stack.PopValue("local")
EndSub

Sub Parse_State
' state ::= []{||[]}[_SQ*]
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
Lex_Space0()
If match Then
Parse_Ope()
_val[1] = val
If match Then
_opt[1] = "ope"
Else
Parse_Let()
_val[2] = val
EndIf
If match Then
_opt[1] = "let"
Else
Lex_Space0()
If match Then
_opt[1] = ""
EndIf
EndIf
EndIf
If match Then
Stack.PushValue("ptr",ptr)
txt = SQ
Lex_Text()
_const[1] = val
If match Then
_ptr = Text.GetIndexOf(buf, CRLF)
If _ptr = 0 Then
_ptr = len + 1
EndIf
ptr = _ptr
match = "True"
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
match = "True"
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Let
' let ::= {|<_var>}[]=[]
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
Parse_Prop()
_val[1] = val
If match Then
_opt[1] = "prop"
Else
Lex_Var()
_val[2] = val
If match Then
_opt[1] = "_var"
EndIf
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = "="
Lex_Text()
_const[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Expr()
_val[3] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
Exec_Let()
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Expr
' expr ::= [[]{+|-}[]]
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
Parse_Term()
_val[1] = val
If match Then
Stack.PushValue("ptr",ptr)
Lex_Space0()
If match Then
txt = "+"
Lex_Text()
_const[1] = val
If match Then
_opt[1] = "+"
Else
txt = "-"
Lex_Text()
_const[2] = val
If match Then
_opt[1] = "-"
EndIf
EndIf
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Term()
_val[2] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
match = "True"
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
Exec_Expr()
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Term
' term ::= [[]{'*'|/}[]]
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
Parse_Factor()
_val[1] = val
If match Then
Stack.PushValue("ptr",ptr)
Lex_Space0()
If match Then
txt = "*"
Lex_Text()
_const[1] = val
If match Then
_opt[1] = "*"
Else
txt = "/"
Lex_Text()
_const[2] = val
If match Then
_opt[1] = "/"
EndIf
EndIf
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Factor()
_val[2] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
match = "True"
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
Exec_Term()
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Factor
' factor ::= {|([][])}
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Parse_Val()
_val[1] = val
If match Then
_opt[1] = "val"
Else
Stack.PushValue("ptr",ptr)
txt = "("
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Term()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[2] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
_opt[1] = ")"
EndIf
EndIf
Exec_Factor()
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Val
' val ::= {|||<_var>}
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Parse_Literal()
_val[1] = val
If match Then
_opt[1] = "literal"
Else
Parse_Prop()
_val[2] = val
EndIf
If match Then
_opt[1] = "prop"
Else
Parse_Ope()
_val[3] = val
EndIf
If match Then
_opt[1] = "ope"
Else
Lex_Var()
_val[4] = val
If match Then
_opt[1] = "_var"
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Literal
' literal ::= {|<_str>}
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Parse_Real()
_val[1] = val
If match Then
_opt[1] = "real"
Else
Lex_Str()
_val[2] = val
If match Then
_opt[1] = "_str"
EndIf
EndIf
Exec_Literal()
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Real
' real ::= [-]<_num>[.<_num>]
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "-"
Lex_Text()
_const[1] = val
match = "True"
If match Then
Lex_Num()
_val[1] = val
EndIf
If match Then
Stack.PushValue("ptr",ptr)
txt = "."
Lex_Text()
_const[2] = val
If match Then
Lex_Num()
_val[2] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
match = "True"
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
Exec_Real()
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Ope
' ope ::= {|}
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Parse_VoidOpe()
_val[1] = val
If match Then
_opt[1] = "voidOpe"
Else
Parse_ValOpe()
_val[2] = val
If match Then
_opt[1] = "valOpe"
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_VoidOpe
' voidOpe ::= {||||||||||||||}
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Parse_Clear()
_val[1] = val
If match Then
_opt[1] = "clear"
Else
Parse_DBText()
_val[2] = val
EndIf
If match Then
_opt[1] = "dBText"
Else
Parse_DEll()
_val[3] = val
EndIf
If match Then
_opt[1] = "dEll"
Else
Parse_DIma()
_val[4] = val
EndIf
If match Then
_opt[1] = "dIma"
Else
Parse_DLine()
_val[5] = val
EndIf
If match Then
_opt[1] = "dLine"
Else
Parse_DRect()
_val[6] = val
EndIf
If match Then
_opt[1] = "dRect"
Else
Parse_DRIma()
_val[7] = val
EndIf
If match Then
_opt[1] = "dRIma"
Else
Parse_DText()
_val[8] = val
EndIf
If match Then
_opt[1] = "dText"
Else
Parse_DTri()
_val[9] = val
EndIf
If match Then
_opt[1] = "dTri"
Else
Parse_FEll()
_val[10] = val
EndIf
If match Then
_opt[1] = "fEll"
Else
Parse_FRect()
_val[11] = val
EndIf
If match Then
_opt[1] = "fRect"
Else
Parse_FTri()
_val[12] = val
EndIf
If match Then
_opt[1] = "fTri"
Else
Parse_SPix()
_val[13] = val
EndIf
If match Then
_opt[1] = "sPix"
Else
Parse_Show()
_val[14] = val
EndIf
If match Then
_opt[1] = "show"
Else
Parse_SMsg()
_val[15] = val
If match Then
_opt[1] = "sMsg"
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Clear
' clear ::= GraphicsWindow.Clear[]([])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.Clear"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[3] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.Clear()
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.Clear()")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_DBText
' dBText ::= GraphicsWindow.DrawBoundText[]([][],[][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.DrawBoundText"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[6] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.DrawBoundText(_val[1], _val[2], _val[3], _val[4])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.DrawBoundText(" + _val[1] + "," + _val[2] + "," + _val[3] + "," + _val[4] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_DEll
' dEll ::= GraphicsWindow.DrawEllipse[]([][],[][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.DrawEllipse"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[6] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.DrawEllipse(_val[1], _val[2], _val[3], _val[4])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.DrawEllipse(" + _val[1] + "," + _val[2] + "," + _val[3] + "," + _val[4] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_DIma
' dIma ::= GraphicsWindow.DrawImage[]([][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.DrawImage"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[5] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.DrawImage(_val[1], _val[2], _val[3])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.DrawImage(" + _val[1] + "," + _val[2] + "," + _val[3] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_DLine
' dLine ::= GraphicsWindow.DrawLine[]([][],[][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.DrawLine"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[6] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.DrawLine(_val[1], _val[2], _val[3], _val[4])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.DrawLine(" + _val[1] + "," + _val[2] + "," + _val[3] + "," + _val[4] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_DRect
' dRect ::= GraphicsWindow.DrawRectangle[]([][],[][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.DrawRectangle"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[6] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.DrawRectangle(_val[1], _val[2], _val[3], _val[4])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.DrawRectangle(" + _val[1] + "," + _val[2] + "," + _val[3] + "," + _val[4] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_DRIma
' dRIma ::= GraphicsWindow.DrawResizedImage[]([][],[][],[][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.DrawResizedImage"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[6] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[7] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.DrawResizedImage(_val[1], _val[2], _val[3], _val[4], _val[5])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.DrawResizedImage(" + _val[1] + "," + _val[2] + "," + _val[3] + "," + _val[4] + "," + _val[5] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_DText
' dText ::= GraphicsWindow.DrawText[]([][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.DrawText"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[5] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.DrawText(_val[1], _val[2], _val[3])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.DrawText(" + _val[1] + "," + _val[2] + "," + _val[3] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_DTri
' dTri ::= GraphicsWindow.DrawTriangle[]([][],[][],[][],[][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.DrawTriangle"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[6] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[7] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[6] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[8] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.DrawTriangle(_val[1], _val[2], _val[3], _val[4], _val[5], _val[6])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.DrawTriangle(" + _val[1] + "," + _val[2] + "," + _val[3] + "," + _val[4] + "," + _val[5] + "," + _val[6] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_FEll
' fEll ::= GraphicsWindow.FillEllipse[]([][],[][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.FillEllipse"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[6] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.FillEllipse(_val[1], _val[2], _val[3], _val[4])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.FillEllipse(" + _val[1] + "," + _val[2] + "," + _val[3] + "," + _val[4] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_FRect
' fRect ::= GraphicsWindow.FillRectangle[]([][],[][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.FillRectangle"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[6] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.FillRectangle(_val[1], _val[2], _val[3], _val[4])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.FillRectangle(" + _val[1] + "," + _val[2] + "," + _val[3] + "," + _val[4] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_FTri
' fTri ::= GraphicsWindow.FillTriangle[]([][],[][],[][],[][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.FillTriangle"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[6] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[5] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[7] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[6] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[8] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.FillTriangle(_val[1], _val[2], _val[3], _val[4], _val[5], _val[6])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.FillTriangle(" + _val[1] + "," + _val[2] + "," + _val[3] + "," + _val[4] + "," + _val[5] + "," + _val[6] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_SPix
' sPix ::= GraphicsWindow.SetPixel[]([][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.SetPixel"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[5] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.SetPixel(_val[1], _val[2], _val[3])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.SetPixel(" + _val[1] + "," + _val[2] + "," + _val[3] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Show
' show ::= GraphicsWindow.Show[]([])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.Show"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[3] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.Show()
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.Show()")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_SMsg
' sMsg ::= GraphicsWindow.ShowMessage[]([][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.ShowMessage"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[4] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
GraphicsWindow.ShowMessage(_val[1], _val[2])
If traceX Then
TextWindow.WriteLine("! GraphicsWindow.ShowMessage(" + _val[1] + "," + _val[2] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_ValOpe
' valOpe ::= {||}
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Parse_GRGB()
_val[1] = val
If match Then
_opt[1] = "gRGB"
Else
Parse_GPix()
_val[2] = val
EndIf
If match Then
_opt[1] = "gPix"
Else
Parse_GCol()
_val[3] = val
If match Then
_opt[1] = "gCol"
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_GRGB
' gRGB ::= GraphicsWindow.GetColorFromRGB[]([][],[][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.GetColorFromRGB"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[4] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[5] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
val = GraphicsWindow.GetColorFromRGB(_val[1], _val[2], _val[3])
If traceX Then
TextWindow.WriteLine("! " + val + "=GraphicsWindow.GetColorFromRGB(" + _val[1] + "," + _val[2] + "," + _val[3] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_GPix
' gPix ::= GraphicsWindow.GetPixel[]([][],[][])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.GetPixel"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[1] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ","
Lex_Text()
_const[3] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
Parse_Val()
_val[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[4] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
val = GraphicsWindow.GetPixel(_val[1], _val[2])
If traceX Then
TextWindow.WriteLine("! " + val + "=GraphicsWindow.GetPixel(" + _val[1] + "," + _val[2] + ")")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_GCol
' gCol ::= GraphicsWindow.GetRandomColor[]([])
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Stack.PushValue("ptr",ptr)
txt = "GraphicsWindow.GetRandomColor"
Lex_Text()
_const[1] = val
If match Then
Lex_Space0()
EndIf
If match Then
txt = "("
Lex_Text()
_const[2] = val
EndIf
If match Then
Lex_Space0()
EndIf
If match Then
txt = ")"
Lex_Text()
_const[3] = val
EndIf
_ptr = Stack.PopValue("ptr")
If match = "False" Then
ptr = _ptr
EndIf
If match Then
val = GraphicsWindow.GetRandomColor()
If traceX Then
TextWindow.WriteLine("! " + val + "=GraphicsWindow.GetRandomColor()")
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Prop
' prop ::= {||||||||||||}
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
Parse_Bg()
_val[1] = val
If match Then
_opt[1] = "bg"
Else
Parse_Bc()
_val[2] = val
EndIf
If match Then
_opt[1] = "bc"
Else
Parse_Fb()
_val[3] = val
EndIf
If match Then
_opt[1] = "fb"
Else
Parse_Fi()
_val[4] = val
EndIf
If match Then
_opt[1] = "fi"
Else
Parse_Fn()
_val[5] = val
EndIf
If match Then
_opt[1] = "fn"
Else
Parse_Fs()
_val[6] = val
EndIf
If match Then
_opt[1] = "fs"
Else
Parse_Hi()
_val[7] = val
EndIf
If match Then
_opt[1] = "hi"
Else
Parse_Le()
_val[8] = val
EndIf
If match Then
_opt[1] = "le"
Else
Parse_Pc()
_val[9] = val
EndIf
If match Then
_opt[1] = "pc"
Else
Parse_Pw()
_val[10] = val
EndIf
If match Then
_opt[1] = "pw"
Else
Parse_Ti()
_val[11] = val
EndIf
If match Then
_opt[1] = "ti"
Else
Parse_To()
_val[12] = val
EndIf
If match Then
_opt[1] = "to"
Else
Parse_Wi()
_val[13] = val
If match Then
_opt[1] = "wi"
EndIf
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Bg
' bg ::= GraphicsWindow.BackgroundColor
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.BackgroundColor"
Lex_Text()
_const[1] = val
If match Then
prop = "bg"
val = GraphicsWindow.BackgroundColor
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Bc
' bc ::= GraphicsWindow.BrushColor
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.BrushColor"
Lex_Text()
_const[1] = val
If match Then
prop = "bc"
val = GraphicsWindow.BrushColor
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Fb
' fb ::= GraphicsWindow.FontBold
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.FontBold"
Lex_Text()
_const[1] = val
If match Then
prop = "fb"
val = GraphicsWindow.FontBold
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Fi
' fi ::= GraphicsWindow.FontItalic
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.FontItalic"
Lex_Text()
_const[1] = val
If match Then
prop = "fi"
val = GraphicsWindow.FontItalic
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Fn
' fn ::= GraphicsWindow.FontName
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.FontName"
Lex_Text()
_const[1] = val
If match Then
prop = "fn"
val = GraphicsWindow.FontName
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Fs
' fs ::= GraphicsWindow.FontSize
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.FontSize"
Lex_Text()
_const[1] = val
If match Then
prop = "fs"
val = GraphicsWindow.FontSize
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Hi
' hi ::= GraphicsWindow.Height
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.Height"
Lex_Text()
_const[1] = val
If match Then
prop = "hi"
val = GraphicsWindow.Height
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Le
' le ::= GraphicsWindow.Left
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.Left"
Lex_Text()
_const[1] = val
If match Then
prop = "le"
val = GraphicsWindow.Left
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Pc
' pc ::= GraphicsWindow.PenColor
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.PenColor"
Lex_Text()
_const[1] = val
If match Then
prop = "pc"
val = GraphicsWindow.PenColor
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Pw
' pw ::= GraphicsWindow.PenWidth
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.PenWidth"
Lex_Text()
_const[1] = val
If match Then
prop = "pw"
val = GraphicsWindow.PenWidth
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Ti
' ti ::= GraphicsWindow.Title
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.Title"
Lex_Text()
_const[1] = val
If match Then
prop = "ti"
val = GraphicsWindow.Title
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_To
' to ::= GraphicsWindow.Top
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.Top"
Lex_Text()
_const[1] = val
If match Then
prop = "to"
val = GraphicsWindow.Top
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub

Sub Parse_Wi
' wi ::= GraphicsWindow.Width
If traceC Then
TextWindow.WriteLine(" " + ptr)
EndIf
_const = ""
Stack.PushValue("local", _opt)
_opt = ""
Stack.PushValue("local", _val)
_val = ""
txt = "GraphicsWindow.Width"
Lex_Text()
_const[1] = val
If match Then
prop = "wi"
val = GraphicsWindow.Width
EndIf
_val = Stack.PopValue("local")
_opt = Stack.PopValue("local")
If traceC Then
TextWindow.WriteLine("
" + ptr)
EndIf
EndSub