Harbour and YACC/LEX

74 views
Skip to first unread message

shov...@ask-services.com

unread,
Apr 29, 2019, 4:26:27 PM4/29/19
to Harbour Users
I'm interested in writing a linter for Harbour. Do you know if there is a LEX/YACC library anywhere and a grammar that I can get started from, or should I roll my own? 
-Seth

Antonino Perricone

unread,
Apr 30, 2019, 3:34:40 AM4/30/19
to Harbour Users
The main Yacc is in https://github.com/harbour/core/blob/master/src/compiler/harbour.y , personally I did not study it, so I don't know if it is useful for your purpose.
On VSCode, My extension lints the code calling harbour executable with -s (syntax check only), -m (compile module only) and -n0 (no implicit starting procedure) options, then parse the output.

Reply all
Reply to author
Forward
0 new messages