I have written a parser for the new grammar, its code is even a bit shorter than the old parser, and I'd say it's much more cleaner, as it's separated into several functions etc.
Now I need to write the recipe matching - get the recipe that represents the current arrangement on the crafting table. This is gonna be a bit more difficult
It seems that the "*:2"-style coords would make the recipe matcher too complicated. I think I'll step down from that feature. So the coord grammar is revised:
This means that either full coords must be given, or a single asterisk, meaning "anywhere".
Note that "anywhere" may match already matched items, so the following recipe wouldn't work:
Now I need to write the recipe matching - get the recipe that represents the current arrangement on the crafting table. This is gonna be a bit more difficult
It seems that the "*:2"-style coords would make the recipe matcher too complicated. I think I'll step down from that feature. So the coord grammar is revised:
Code:
<IngredientN> = <ItemType>, <Coord1>, <Coord2>, ... <CordN>
<CoordN> = <X>:<Y> or *
Note that "anywhere" may match already matched items, so the following recipe wouldn't work:
Code:
# Sticks:
Planks, *, * | Stick, 4
# This would match even a single pile of at least 2 planks