--[[ Sandwich DSL Builder Test Driver CSci 658: Software Language Engineering, Fall 2013 Exam 1, Problem 3 H. Conrad Cunningham, Professor Computer and Information Science University of Mississippi 1234567890123456789012345678901234567890123456789012345678901234567890 2013-11-25: Developed test driver and initial tests The internal DSL test is called inline rather than dynamically loaded as in the Lair examples. --]] -- Import Sandwich Semantic Model local sm = require "sandwich_model" local makePlatter, makeSandwich, addSandwich, addLayer, valToString = sm.makePlatter, sm.makeSandwich, sm.addSandwich, sm.addLayer, sm.valToString -- Import Sandwich Builder local sb = require "sandwich_builder" local platter, end_platter, get_platter = sb.platter, sb.end_platter, sb.get_platter local sandwich = sb.sandwich local bread, meats, cheeses, vegetables, condiments = sb.bread, sb.meats, sb.cheeses, sb.vegetables, sb.condiments -- DSL test print("\nBegin Sandwich DSL test 1") -- Begin DSL script platter() sandwich() meats("turkey") cheeses("Swiss") bread("rye") vegetables("tomato") condiments("mayo") sandwich() meats("tofu") condiments("mustard") bread("wheat") sandwich() bread("white","wheat") bread("rye") meats("turkey","ham") meats("tofu") meats("jelly") vegetables() vegetables("onion","tomato") cheeses("Jack","cheddar","Swiss") condiments("mayo","mustard") sandwich() cheeses("American") end_platter() -- End DSL script local pltr = get_platter() print("\nPlatter created by DSL is\n" .. valToString(pltr))