im having trouble trying to work with VB

6 views
Skip to first unread message

tikych...@gmail.com

unread,
May 25, 2008, 1:19:48 AM5/25/08
to GOLD Parsing System
When i generate the .bas and add the .dll... i don't know what else to
do
i found the lines of the Case Rule_***** and it supossely be there
where i write my code to do... if that rule is true ... right?? I
wanna be able to work with the numbers and id's that the parser
returns

I had done everything... or something is missing??
I made the skeletton program
I made a new project in vb and add the .bas module
I added the .dll engine
I changed the Parser.LoadCompledGrammar source to the path were my
program .cgt table was
I Called the Setup
I Called the DoParse with a file with a correct grammar that worked in
the test wizard
but it doesn't even do a simple msgbox in the Case Rule_**** part

Alok

unread,
May 28, 2008, 5:41:01 PM5/28/08
to GOLD Parsing System
Dear tiky,

I am not sure what you mean by "Rule_*", as that does not appear in
the DLL source code. If you have the DLL and a compiled CGT file, you
should be able to
1) Make a new VB project
2) Add a reference to GOLD Parser dll
3) paste in the following code, changing the CGT and text file to ones
that match your CGT and source text
4) run the sub (i.e. add a button or something that calls it from VB,
or F5 if VBA)

Sub testCGT()
Dim gpt As GOLDParserEngine.GOLDParser
Set gpt = New GOLDParserEngine.GOLDParser
gpt.LoadCompiledGrammar "test.cgt"
Debug.Print "toks: " & gpt.TokenCount
Debug.Print "rules " & gpt.RuleTableCount
Debug.Print "symbols " & gpt.SymbolTableCount
gpt.OpenFile "C:\tmp.txt"
Dim RES As GPMessageConstants
RES = gpt.Parse

Do While RES <> gpMsgNotLoadedError And RES <> gpMsgAccept And RES
<> gpMsgSyntaxError And RES <> gpMsgLexicalError
RES = gpt.Parse
If Not gpt.CurrentToken Is Nothing Then
Debug.Print "tok: " & gpt.CurrentToken.Name
Else
Debug.Print "tok: Nothing"
End If
Loop
End Sub
Reply all
Reply to author
Forward
0 new messages