Hi, Iīm working with an application that read some plain text configuration files like this:

(event "LinkUp " (match "" (property_1 "" (option_1 "192.168.0.1") ) (property_2 "" (option_2 "6") ) (property_3 "" (option_1 "") (value "1234") ) ) )

The main issue, is when there are syntax error on this kind of files. I mean if there are missing open parenthesis, bracket or quotes, or if the tags has the wrong name (application is case sensitive), and there are some rules inside the configuration file like:

property_1 can be an empty value "" or include the option_1 with a value

property_2: can be a number 1,2,3,4,5,6,7

property_3: has 3 options: an empty value "", a fix value inside the double quotes "1", or use the option_1 tag

I have a basic experience with Perl, I used in the past some CPAN modules, but honestly I donīt know how can I write a syntax checker, do you know if a CPAN module can help me or can you give me please some ideas? Thanks in advance


In reply to Make a Syntax checker by dalbaranster

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.