News for hackers. Stuff that matters.
Re:Parsing Algorithms by humanlion87 on Monday October 26, 2020 @04:15PM (#24900827)
Apologies for the tangential question. I am currently working on a codebase that involves trying to understand code that parses and input string (that has various search parameters and values) and generates an appropriate SQL query to search the associated database. I am struggling to build a mental model of how this parsing works. Will going through one of the resources mentioned in this thread help with my understanding?
Re:Parsing Algorithms by DmitrySoshnikov on Monday October 26, 2020 @04:23PM (#24900926)
Yes, if you need to parse that input string to generates an appropriate SQL query, you would need to have a small DSL (domain-specific language) for that "string", whatever it contains. If the string contains SQL-like syntax, e.g. "SELECT name from users", then yes, it would be easy to build a grammar for this.