Asking advice to make condition parsor

Hi guys, for my project need, I am actually coding a file parsor, to basically import software information from a file. This file information can as well use simple conditions, like if statement.

I am just seeking some advice to implement conditional parsing. Which approach do you think to use in this case.

I will give you an example of how the file will look like:

PORT
    OfficeSoftwares-Main
NAME
    Libreoffice
VERSION
    24.8.4-r2
ARCHITECTURES
    x86_64
    arm64
DESCRIPTION
    Free and powerful office suite
WEBSITE
    https://www.libreoffice.org/
DEPENDENCIES
    @BaseLibraries-Main:Archive-Zip>=1.68.0
    @GraphicsLibraries-Main:Harfbuzz>=8.1.1(Graphite2)

    if component("C-Library"="Musl") || component("C-Library"="Libc")
        @ProgrammingTools-Main:Musl>=1.2.5
    else
        @ProgrammingTools-Main:Glibc>=2.44.0
    end
KERNELDEPENDENCIES
    CONFIG_X86
    CONFIG_X86_64
OPTIONS
    name: Apache-Ant
    description: Enable apache-ant support
    active: false
    dependencies:
        @ProgrammingTools-Main:Apache-Ant>=1.10.14

    name: Boost
    description: Enable boost support
    active: false
    dependencies:
        @BaseLibraries-Main:Boost>=1.83.0

    name: Gstreamer
    description: Enable gstreamer support
    active: false
    dependencies:
        @MultimediaLibraries-Main:Gstreamer>=1.26.1(Base)
UNIQUEDEPENDENCIES

UNIQUEOPTIONS

ALLOWCODEPENDENCIES

I would like advice specially to translate from a string to a condition. Because condition can have really multiple case :sweat_smile: