Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to write a language parser with AWK?

I just recently started reading up on the AWK programming language, with the intent of creating a programming language parser with it, since it is generally used as a Text processor and/or for pattern matching. I had the thought, "If this language is used for pattern matching, and processing text, couldn't it be used to process a source file for specific statements such as for / if / while keywords and phrases, and then perform the given action, and pass it off to a lexer, or something of the sort?" I've done some research online, but i'm unable to find any kind of information on this subject.

like image 270
stillfly211 Avatar asked Sep 18 '25 03:09

stillfly211


1 Answers

AWK can be used to create Language grammars when you combine it with other Linux/Unix tools such as sed and shell (BASH/KSH) programming. Typically though other tools are better suited like python, Groovy, Perl, or GO. Each of these languages are better suited to language processing than AWK.

like image 107
joshuad2 Avatar answered Sep 21 '25 00:09

joshuad2