chris murphy ryan overbeck lauren wilcox joeng kim
play

Chris Murphy Ryan Overbeck Lauren Wilcox Joeng Kim Introduction - PowerPoint PPT Presentation

Chris Murphy Ryan Overbeck Lauren Wilcox Joeng Kim Introduction AWK What is MOHAWK? A programming language for processing tabular data from text files Largely based on AWK Runtime Architecture


  1. Chris Murphy Ryan Overbeck Lauren Wilcox Joeng Kim

  2. Introduction ����������� AWK

  3. What is MOHAWK? • A programming language for processing tabular data from text files • Largely based on AWK

  4. Runtime Architecture MOHAWK Source Program Input MOHAWK Output (Text File) Interpreter (Text File)

  5. Mohawk Program • A series of pattern/action statements • Patterns are: – “-:-|” (Forward MOHAWK) – “|-:-” (Reverse MOHAWK) – A numeric, boolean, or string valued expression – Nothing. • Actions are a series of: – Math, boolean, and string expressions – Conditional statements – Function calls – I/O Control

  6. Distinguishing Features • Uses ‘!’ as a statement terminator • No data types (like AWK) • Java style comments • Linking numbered fields with meaningful string identifiers • New variable scoping rules • Most keywords are IRC style smilies

  7. Tutorial Introduction/Example BEGIN BODY END

  8. I n p u t f i l e MOHAWK Output file

  9. Tutorial Introduction / Example BEGIN BODY END

  10. Tutorial Introduction / Example I n p u t f i l e MOHAWK Output file

  11. MOHAWK Component Architecture MohawkMain MohawkFileLoader Front End MohawkLexer MohawkParser MohawkAntlrTokenTypes Exceptions MohawkBreak Tree Walker MohawkWalker MohawkContinue MohawkExit MohawkWalkerTokenTypes MohawkNext Back End MohawkStringOperator MohawkMathOperator MohawkSymbols MohawkLogicalOperator MohawkDataType MohawkFunctionHandler MohawkOperator

  12. Back End Components MohawkSymbols MohawkDataType push intValue pop floatValue branch booleanValue endBranch put putGlobal get link exists cleanFieldVariables MohawkMathOperator MohawkLogicalOperator add equals subtract notEquals multiply lessThan divide MohawkFunctionHandler greaterThan mod lessThanOrEquals negate register greaterThanOrEquals exp call match or and MohawkStringOperator not concatenate

  13. Testing • Unit Testing – JUnit – Test operators • Parser Testing – Expected Tokens • Function Testing – Expected Output

  14. Lessons Learned • Good language design requires balance • Impossible to stick to original specifications • Details behind creating a language – Operator Precedence – Variable Scoping – Data type Manipulation • Importance of Testing Early and Testing Often

Recommend


More recommend