# Custom language parser autocomplete

**URL:** <https://forum.elixirforum.com/t/custom-language-parser-autocomplete/31620>\
**Category:** Questions\
**Tags:** programming-languages, parsers\
**Created:** [May 18, 2020, 9:58pm UTC](https://forum.elixirforum.com/t/custom-language-parser-autocomplete/31620 "2020-05-18T21:58:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![mattste](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/mattste/32/19260_2.png) [@mattste](https://forum.elixirforum.com/u/mattste)\
**Post date:** [May 18, 2020, 9:58pm UTC](https://forum.elixirforum.com/t/custom-language-parser-autocomplete/31620/1 "2020-05-18T21:58:10Z")

</div>

Our frontend is implementing a custom language for users to query data (simpler than SQL). I am wondering if any parsing libraries exist that could help me provide “autocomplete” like functionality.

For example, a user types `if points` and then an autocomplete would pop-up with a list of next possible tokens such as `[">", "<", "="]` .

I’ve looked at NimbleParsec and leex/yacc but can’t seem to find anything for getting the next possible tokens.

---

<div class="post-metadata">

**Author:** ![stefanchrobot](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/stefanchrobot/32/7657_2.png) [@stefanchrobot](https://forum.elixirforum.com/u/stefanchrobot)\
**Post date:** [June 3, 2020, 11:20am UTC](https://forum.elixirforum.com/t/custom-language-parser-autocomplete/31620/2 "2020-06-03T11:20:59Z")

</div>

I think the solution here is to write a hand-rolled parser that on partial parse returns the next expected token. You might be able to extract this information from parser generator’s error, but that depends on the tool.
