compilerSyntaxError self, "Invalid command, syntax is '"&&word1oftLine&&"<source> [ as <target> [ base <base-source> ] ]'", tLineNumber
end if
-- Put together the command
put"copy"intotCommand["type"]
putword1oftLineintotCommand["class"]
put wordToName(word2oftLine) intotCommand["source"]
ifthenumberofwordsoftLine>=4then
put wordToName(word4oftLine) intotCommand["target"]
end if
ifthenumberofwordsoftLine>=6then
put wordToName(word6oftLine) intotCommand["source-base"]
end if
break
case"emit"
localtClass
put wordToName(word2oftLine) intotClass
localtMaxWords
switchtClass
case"externals"
case"dbdrivers"
deletethelastcharoftClass
put4intotMaxWords
break
case"string"
case"variable"
put5intotMaxWords
put wordToName(word3oftLine) intotCommand["name"]
break
default
put0intotMaxWords
end switch
ifthenumberofwordsoftLineis nottMaxWordsor \
word-2oftLineis not"to"then
compilerSyntaxError self, "Invalid command, syntax is 'emit <class> [{<variable> | <string>}] to <target>'", tLineNumber
end if
put"emit"intotCommand["type"]
puttClassintotCommand["class"]
put wordToName(word-1oftLine) intotCommand["target"]
break
case"declare"
ifthenumberofwordsoftLineis not5or \
word2oftLineis not amongtheitemsof"external,dbdriver"or \
word4oftLineis not"using"then
compilerSyntaxError self, "Invalid command, syntax is 'declare external <name> using <filelist>'", tLineNumber
end if
put"declare"intotCommand["type"]
put wordToName(word2oftLine) intotCommand["class"]
put wordToName(word3oftLine) intotCommand["name"]
put wordToName(word5oftLine) intotCommand["files"]
break
case"if"
case"ifnot"
if not (thenumberofwordsoftLineis5andword3oftLineis"is"andword5oftLineis"then") and \
not (thenumberofwordsoftLineis4andword3oftLineis"exists"andword4oftLineis"then") then
compilerSyntaxError self, "Invalid command, syntax is 'if[not] <name> ( is <name> | exists ) then'", tLineNumber
end if
-- This command places a new context
put"if"& return aftertContext
-- It also implies an implicit push
puttrueintotNeedPush
-- Add the command
put"if"intotCommand["type"]
ifword1oftLineis"ifnot"then
puttrueintotCommand["negated"]
end if
put wordToName(word2oftLine) intotCommand["left"]
ifthenumberofwordsoftLineis5then
put wordToName(word4oftLine) intotCommand["right"]
end if
break
case"shortcut"
if not (thenumberofwordsoftLineis4andword3oftLineis"to") and \
not thenumberofwordsoftLineis2then
compilerSyntaxError self, "Invalid command, syntax is 'shortcut <name> [ to <target> ]'", tLineNumber
end if
put"shortcut"intotCommand["type"]
put wordToName(word2oftLine) intotCommand["source"]
ifthenumberofwordsoftLineis4then
put wordToName(word4oftLine) intotCommand["target"]
end if
break
case"place"
ifthenumberofwordsoftLineis not4or \
word2oftLineis not amongtheitemsof"record,uninstaller"or \
word3oftLineis not"at"then
compilerSyntaxError self, "Invalid command, syntax is 'place (record|uninstaller) at <target>'", tLineNumber
end if
put"place"intotCommand["type"]
putword2oftLineintotCommand["class"]
put wordToName(word4oftLine) intotCommand["target"]
break
case"register"
if not (thenumberofwordsoftLineis3andword2oftLineis"key") and \
not (thenumberofwordsoftLineis5andword2oftLineis amongthewordsof"key value"andword4oftLineis"as") and \
not (thenumberofwordsoftLineis7andword2oftLineis"value"andword4oftLineis"of"andword6oftLineis"as") and \
not (thenumberofwordsoftLineis6andword2oftLineis amongthewordsof"key value"andword4oftLineis"as"andword5oftLineis amongthewordsof"string path number") and \
not (thenumberofwordsoftLineis8andword2oftLineis"value"andword4oftLineis"of"andword6oftLineis"as"andword7oftLineis amongthewordsof"string path number") then
compilerSyntaxError self, "Invalid command, syntax is 'register (value | key) <key_or_value> [ of <key> ] [ as <value> ]'", tLineNumber
end if
put"register"intotCommand["type"]
putword2oftLineintotCommand["class"]
put wordToName(word3oftLine) intotCommand["target"]
localtRegistryValue, tRegistryType
ifthenumberofwordsoftLineis5then
putword5oftLineintotRegistryValue
putemptyintotRegistryType
elseifthenumberofwordsoftLineis6then
putword6oftLineintotRegistryValue
putword5oftLineintotRegistryType
elseifthenumberofwordsoftLineis7then
putword7oftLineintotRegistryValue
putemptyintotRegistryType
put wordToName(word5oftLine) intotCommand["parent"]
elseifthenumberofwordsoftLineis8then
putword8oftLineintotRegistryValue
putword7oftLineintotRegistryType
put wordToName(word5oftLine) intotCommand["parent"]
end if
iftRegistryTypeisemptythen
ifchar1oftRegistryValueisquoteortRegistryValueis not anintegerthen
put"string"intotCommand["value_type"]
put wordToName(tRegistryValue) intotCommand["value"]
else
put"number"intotCommand["value_type"]
puttRegistryValueintotCommand["value"]
end if
else
puttRegistryTypeintotCommand["value_type"]
put wordToName(tRegistryValue) intotCommand["value"]