How to Implement a BNF syntax in perl?

Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default How to Implement a BNF syntax in perl?

    Hi,

    I have a long BNF (Backus-naur form) for parsing a protocol message. Suppose I want to implement a BNF like this

    Response = Status-line
    *(message-header)
    CRLF
    [Message-body]

    status-Line = SIP-Version SP Status-Code SP Reason-Phrase CRLF
    SP = space character
    ...................
    ..................

    Like this I have a very long BNF. How can I implement this BNF and parse a message that satisfies this BNF in perl ?
    Any suggestions would be of great help to me.

    Thanks,
    Balaji

    Yahoo! India Mobile: Ringtones, Wallpapers, Picture Messages and more.Download now.
    Balaji thoguluva Guest

  2. Similar Questions and Discussions

    1. Perl Syntax Highlighting
      Greetings fellow members, I am in search for Perl/CGI definitions for use within CodeColoring.xml and Colors.xml. Perl syntax highlighting would...
    2. [ANNOUNCE] Apache::Syntax::Highlight::Perl 1.00
      The uploaded file Apache-Syntax-Highlight-Perl-1.00.tar.gz has entered CPAN as file:...
    3. my in the perl syntax
      Well I am very new to Perl. I have read Oreily's Camel book, but haven't found any thing about my that is used in any of the code. e.g my $var...
    4. Simple Perl code/syntax question
      > Hallo everyone and thank you for your previous help Well there is the FAQ about case statements: perldoc -q 'switch or case' In your case...
    5. Perl Math Syntax
      Hello peoples, Needs some help getting a ... well ... pretty basic math script working but the solution eludes me .... I have a text file called...
  3. #2

    Default Re: How to Implement a BNF syntax in perl?

    For Quality purpouses, Balaji Thoguluva 's mail on Friday 06 February 2004
    18:49 may have been monitored or recorded as:
    > Hi,
    Hi
    > I have a long BNF (Backus-naur form) for parsing a protocol message.
    > Suppose I want to implement a BNF like this
    >
    > Response = Status-line
    > *(message-header)
    > CRLF
    > [Message-body]
    >
    > status-Line = SIP-Version SP Status-Code SP Reason-Phrase CRLF
    > SP = space character
    > ..................
    > .................
    >
    > Like this I have a very long BNF. How can I implement this BNF and
    > parse a message that satisfies this BNF in perl ? Any suggestions would be
    > of great help to me.
    Maybe Config::Natural is good to you.

    Wolf

    Wolf Blaum Guest

  4. #3

    Default Re: How to Implement a BNF syntax in perl?

    On 02/06/04 12:49, Balaji Thoguluva wrote:
    > Hi,
    >
    > I have a long BNF (Backus-naur form) for parsing a protocol message. Suppose I want to implement a BNF like this
    >
    > Response = Status-line
    > *(message-header)
    > CRLF
    > [Message-body]
    >
    > status-Line = SIP-Version SP Status-Code SP Reason-Phrase CRLF
    > SP = space character
    > ..................
    > .................
    >
    > Like this I have a very long BNF. How can I implement this BNF and parse a message that satisfies this BNF in perl ?
    > Any suggestions would be of great help to me.
    Have you looked at Parse::RecDescent:
    <http://search.cpan.org/dist/Parse-RecDescent/>

    Randy.
    Randy W. Sims Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139