The Arcane Interpreter
Define a grammatical representation for a language and an interpreter to evaluate it within Make.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Interpreter
ARCANUM SCHOOL: Divination // Linguistics
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
# A rudimentary interpreter for an arcane script
# Syntax: SCRIPT="SUMMON demon BIND circle BANISH"
SCRIPT ?= "SUMMON demon BIND circle"
# Map keywords to make targets
.PHONY: eval SUMMON BIND BANISH demon circle
demon:
@echo "[Target: Demon]"
circle:
@echo "[Location: Binding Circle]"
SUMMON:
@echo "Interpreting SUMMON..."
BIND:
@echo "Interpreting BIND..."
BANISH:
@echo "Interpreting BANISH..."
# The interpreter loop using Make's filter/foreach
eval:
@echo "Evaluating Script: $(SCRIPT)"
@for token in $(SCRIPT); do \
$(MAKE) --no-print-directory $$token; \
done
Runic Tags:
#makefile
#behavioral
#interpreter
#parsing