Ok, i'll have a look at that. (hopefully i'm 1337 enough to make it).
From,
Nice coder
Building a parser (not solved)
Since it looks like you might be considering using languages other than VB I also suggest that you take a look at ANTLR ( www.antlr.org ). It's basically Yacc/Bison and Flex/Lex on steroids and crack (respectively). It generates the lexer, parser, AND tree walker. Creation of abstract syntax tress is built in and it generates source for C++, Java, and C# (all from a single grammar file). It's written in Java, is open source, and has lots of existing grammar files.
Typically creating a grammar and associated support code for AST's is a time consuming task. I started my current grammar file almost two weeks ago (on friday) and it's almost complete - with full AST.
Typically creating a grammar and associated support code for AST's is a time consuming task. I started my current grammar file almost two weeks ago (on friday) and it's almost complete - with full AST.
There are regular expressions in VB6. Go to Project->References. The regular expression library is in there. If it's not, then go to microsoft's website and search for windows scripting host. Download and install.
If you want to extract a specific string from another string with regular expressions, you'll have to group the specific part of the expression with parentheses.
For example (all from memory, so some class names could be wrong):
If you want to extract a specific string from another string with regular expressions, you'll have to group the specific part of the expression with parentheses.
For example (all from memory, so some class names could be wrong):
Dim re as RegExpDim matches as MatchCollectionSet re = New RegExpre.Pattern = "Do you like ([^$]+)$matches = re.Execute(stringToParse)print "You like " & matches.item(0).submatches(0)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement