moichim / labir

https://labir.vercel.app
0 stars 0 forks source link

Make parsers modular #7

Closed moichim closed 5 months ago

moichim commented 5 months ago

Parsers should be modular. It requires:

Parsers are integrated into thermal loader as classes in an array.

Upon file load, the file is passed through all parsers - through its determine method.

Determine method of a parser looks on a file and returns yes or no in case the file matches. No errors are thrown upon determination.

The determination should be a static method since no instance of the parser exists in the given moment.

Once the parser is identified, it is instanced and parsing happens.

During parsing, there is validation.

Errors should be logged somewhere.

moichim commented 5 months ago

Parser determination is executed in ThermalLoader.getParserInstance().