What is called a parser design pattern? A parser using an array of structures containing keywords and function pointers?

I saw parsers where the processing of each keyword is controlled by an array of structures containing each keyword and function pointers, with how to process this keyword. What is called this template?

Instead of trying to include a vague example here, I just point you to my project .

+4
source share
2 answers

This is very similar to Table-Driven parsing , which is commonly used by LR Partisans .

+1
source

Character table (keyword) with procedural attachment?

Is this a linear table without any order?

I have to say that I never did this. I built hash tables containing keywords and action pointers. Find the identifier in the hash table; if clicked, call the key procedure.

0
source

Source: https://habr.com/ru/post/1401099/


All Articles