#! /usr/bin/revolution -ui on startup try generate catch tError write tError & return to stderr end try end startup on generate local tOutput generateErrorsList $1 & slash & "executionerrors.h", "MCexecutionerrors" put the result & return into tOutput generateErrorsList $1 & slash & "parseerrors.h", "MCparsingerrors" put the result & return after tOutput put tOutput into url ("binfile:" & $2) end generate on generateErrorsList pSrcFile, pName local tArray put "const char *" & pName & " =" & return after tArray local tFound put false into tFound repeat for each line tLine in url ("file:" & pSrcFile) if word 1 of tLine is "enum" then put true into tFound end if if not tFound then next repeat end if if word 1 of tLine is "};" then exit repeat end if if word 1 of tLine is "//" and char 1 of word 2 of tLine is "{" then get word 3 to -1 of tLine replace quote with "\" & quote in it put tab & quote & it & "\n" & quote & return after tArray end if end repeat put ";" & return after tArray return tArray end generateErrorsList