Forum > General

Parser and scanner *.pas and forms

(1/1)

Borneq:
If are any libraries with parser and scanner for Pascal files and especially form files?

MarkMLl:
Generic answer: https://wiki.freepascal.org/Make_your_own_compiler,_interpreter,_parser,_or_expression_analyzer is a good place to start.

What are these "form files" of which you speak? :-) This is the general FPC forum and if you have questions relating to a particular IDE- e.g. Lazarus- I suggest asking in a more specific one.

MarkMLl

dsiders:

--- Quote from: Borneq on May 03, 2022, 07:20:57 pm ---If are any libraries with parser and scanner for Pascal files and especially form files?

--- End quote ---

Have you checked the fcl-res package?

https://www.freepascal.org/docs-html/current/fclres/index.html

simone:
I don't know if I understand your request. Form-related units are object pascal source files, like any other. If you need a parser for object pascal, I suggest fcl-passrc. See: https://wiki.freepascal.org/fcl-passrc. Or do you want to parse .lfm files?

PascalDragon:

--- Quote from: Borneq on May 03, 2022, 07:20:57 pm ---If are any libraries with parser and scanner for Pascal files and especially form files?

--- End quote ---

As simone wrote Pascal files themselves are best handled with fcl-passrc as that is also the base for pas2js. For form files (which are not Pascal source files) the code in the RTL is used (mainly Classes.TReader and Classes.TParser). You can see how it's done in principle by looking at Classes.ObjectTextToBinary.

Navigation

[0] Message Index

Go to full version