Search the Community
Showing results for tags 'gold'.
Found 2 results
Hi everyone Are there any people here that know how to use a parser generator that uses 'bnf' (not 'ebnf'!) i'm using the gold parser: http://goldparser.org/index.htm not possible in autoit: https://www.autoitscript.com/forum/topic/167663-activex-gold-parser-in-autoit-is-this-possible/ What i'm looking for is the best way to parse a list: <List> ::= <Item> ',' <List> | <Item> <Item> ::= Number | String for example, the tree returned from: 'test', 1, 2is: since its not possible in AutoIT code I did it in vb script. this is what i did: ' in the parse loop: Case Rule_List_Comma set result = new list call result.input(.tokens(0).data,.tokens(2).data) ' the list class: class list private arg0 private arg1 public sub input(a,b) set arg0 = a set arg1 = b end sub private sub push(item,byref stack) redim preserve stack(ubound(stack) + 1) stack(ubound(stack)) = item end sub public function value value = array(arg0.value) value2 = arg1.value if isarray(value2) then for each thing in value2 push thing,value next else push value2,value end if end function end class is there a better way to do this? regards, TheAutomator
hi everyone i have an interesting question about the gold parser: info: http://www.goldparser.org/index.htm download (regsvr32 to register): http://www.goldparser.org/engine/1/vb6/index.htm on the website it seems that this dll can be used as an activex object, does that mean that it can be used in autoit to? help for the activeX dll: http://www.goldparser.org/engine/1/vb6/doc/index.htm it gives me error code '4' if i try to use it... Const $gpMsgAccept = 3 Const $gpMsgCommentBlockRead = 9 Const $gpMsgCommentError = 7 Const $gpMsgCommentLineRead = 10 Const $gpMsgInternalError = 8 Const $gpMsgLexicalError = 5 Const $gpMsgNotLoadedError = 4 Const $gpMsgReduction = 2 Const $gpMsgSyntaxError = 6 Const $gpMsgTokenRead = 1 $Parser = ObjCreate("goldparserengine.goldparser") $Parser.LoadCompiledGrammar("test_script.cgt") $Parser.OpenFile("Program.txt") $Response = $Parser.Parse() MsgBox(0,'test',$Response) If there are people interested in answering or helping feel free to reply and then i will upload the "test_script.cgt" somewhere if you want i know this question is a bit specific but you never know.. Thanks for reading! TheAutomator.