Reputation: 1343
I want to modify a XPATH parser, but I don't know how to start with. The soure code look like:
Any help would be appreciated:)
Upvotes: 1
Views: 83
Reputation: 243459
It is meaningless to try to modify a parser if the set of rules and the codes for the terminal symbols (and the lexer) aren't available.
The provided code looks like the action table for a general, table driven LR parser. However you also need the GOTO table.
This whole approach is as unsound as reverse engineering. If you want, just build your own parser starting from clean zero so that you'll have freedom and flexibility.
Upvotes: 1
Reputation: 95316
This looks like a "shift reduce" (see the S and Rs) table for an LALR parser. My guess is that it is produced by the GOLD parser which produces application-independent parse tables.
But you won't reasonably be able to modify this without the original grammmar, and the parser generator.
Why would you want to modify a perfectly working XPath parser anyway? If it isn't perfect, why don't you just use a perfect one?
Upvotes: 2