본문 바로가기
  • Home

Implementation of Nondeterministic Compiler Using Monad

  • Journal of The Korea Society of Computer and Information
  • Abbr : JKSCI
  • 2014, 19(2), pp.151-159
  • Publisher : The Korean Society Of Computer And Information
  • Research Area : Engineering > Computer Science

Sugwoo Byun 1

1경성대학교

Accredited

ABSTRACT

We discuss the implementation of a compiler for an imperative programming language, usingmonad in Haskell. This compiler involves a recursive-descent parser conducting nondeterministicparsing, in which backtracking occurs to try with other rules when the application of a productionrule fails to parse an input string. Haskell has some strong facilities for parsing. Its algebraictypes represent abstract syntax trees in a smooth way, and program codes by monad parsing areso concise that they are highly readable and code size is reduced significantly, comparing withother languages. We also deal with the runtime environment of the assembler and code generationwhose target is the Stack-Assembly language based on a stack machine.

Citation status

* References for papers published after 2023 are currently being built.