# If I'm given a list of grammar rules like: (http://www.math.pitt.edu/~bard/bardwar

**URL:** <https://discourse.julialang.org/t/if-im-given-a-list-of-grammar-rules-like-http-www-math-pitt-edu-bard-bardwar/55632>\
**Category:** General Usage\
**Created:** [February 19, 2021, 5:19pm UTC](https://discourse.julialang.org/t/if-im-given-a-list-of-grammar-rules-like-http-www-math-pitt-edu-bard-bardwar/55632 "2021-02-19T17:19:00Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BridgeBot](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bridgebot/32/21491_2.png) [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Post date:** [February 19, 2021, 5:19pm UTC](https://discourse.julialang.org/t/if-im-given-a-list-of-grammar-rules-like-http-www-math-pitt-edu-bard-bardwar/55632/1 "2021-02-19T17:19:01Z")

</div>

if I’m given a list of grammar rules like: [full list](http://www.math.pitt.edu/~bard/bardware/tut/newstyle.html)

```julia
<name>'=<formula>
...
<name>(t)=<formula>
volt <name>=<formula>
...
<name>(t+1)=<formula>
...
<name>=<formula>
...

```

what is the “right” way to parse files that follow these rules in julia? does it amount to me just writing regex or is there an easier way?  
i’m not super experienced in parsing so help appreciated

Note that the original poster on Slack cannot see your response here on Discourse. Consider _transcribing the appropriate answer back to Slack_, or pinging the poster here on Discourse so they can _follow this thread_.  
[(Original message :slack:)](https://julialang.slack.com/archives/C6A044SQH/p1613754983226100?thread_ts=1613754983.226100&cid=C6A044SQH) [(More Info)](https://github.com/JuliaCommunity/SlackBridge)

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [February 19, 2021, 5:26pm UTC](https://discourse.julialang.org/t/if-im-given-a-list-of-grammar-rules-like-http-www-math-pitt-edu-bard-bardwar/55632/2 "2021-02-19T17:26:39Z")

</div>

Sounds like you want to use a parsing/grammar package, like one of:

- [GitHub - vonDonnerstein/StringParserPEG.jl: A Library for Parsing Strings in Julia via Parsing Expression Grammars](https://github.com/vonDonnerstein/StringParserPEG.jl)
- [GitHub - thautwarm/RBNF.jl: A DSL for modern parsing](https://github.com/thautwarm/RBNF.jl)
- [GitHub - gkappler/CombinedParsers.jl: Compiled parser combinators and regular expressions in pure julia](https://github.com/gkappler/CombinedParsers.jl)
- [GitHub - andrewcooke/ParserCombinator.jl: A parser combinator library for Julia](https://github.com/andrewcooke/ParserCombinator.jl)
