package Ġorg . mer ide um . ktor . server . executor Ċ Ċ import Ġorg . antlr . v 4 . runtime . Char Streams Ċ import Ġorg . antlr . v 4 . runtime . Common Token Stream Ċ import Ġorg . antlr . v 4 . runtime . tree . ParseTree Ċ import Ġorg . mer ide um . kotlin . mer it . execution . Mer it Execution Result Ċ import Ġorg . mer ide um . kotlin . mer it . execution . Mer it Executor Ċ import Ġorg . mer ide um . kotlin . mer it . execution . Output Container Ċ import Ġorg . mer ide um . kotlin . mer it . interpreter . Dependency Ċ import Ġorg . mer ide um . kotlin . mer it . interpreter . Dependency Resolver Ċ import Ġorg . mer ide um . kotlin . mer it . interpreter . Variable Scope Ċ import Ġorg . mer ide um . kotlin . mer it . interpreter . visitor s . Mer it Visitor Ċ import Ġorg . mer ide um . mer it . antlr . Mer it Lexer Ċ import Ġorg . mer ide um . mer it . antlr . Mer it Parser Ċ Ċ class ĠSimple Mer it Executor : ĠMer it Executor Ġ{ ĊĊĠ Ġprivate Ġfun Ġlexer ( code : ĠString ) Ġ= ĠMer it Lexer ( Char Streams . fromString ( code )) ĊĊĠ Ġprivate Ġfun Ġparse ( code : ĠString ) Ġ= ĊĠĠĠ ĠMer it Parser ( Common Token Stream ( lexer ( code ))). apply Ġ{ ĊĠĠĠĠĠ Ġbuild ParseTree Ġ= Ġtrue ĊĠĠĠ Ġ}. parse () ĊĊĠ Ġoverride Ġfun Ġexecute ( code : ĠString ): ĠMer it Execution Result Ġ{ ĊĠĠĠ Ġval Ġparse Tree : ĠParse Tree Ġ= Ġparse ( code ) ĊĠĠĠ Ġval Ġmain Scope Ġ= ĠVariable Scope . main () ĊĠĠĠ Ġval Ġoutput Container Ġ= ĠOutput Container ( mutable Map Of ()) ĊĠĠĠ Ġval Ġdependency Resolver Ġ= Ġobject Ġ: ĠDependency Resolver Ġ{ ĊĠĠĠĠĠ Ġoverride Ġfun Ġresolve ( name : ĠString ): ĠDependency Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠSimple Dependency () ĊĠĠĠĠĠ Ġ} ĊĊĠĠĠĠĠ Ġoverride Ġfun Ġresolve ( name : ĠString , Ġpath : ĠString ): ĠDependency ? Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠSimple Dependency () ĊĠĠĠĠĠ Ġ} ĊĠĠĠ Ġ} ĊĠĠĠ Ġval Ġvisitor Ġ= ĠMer it Visitor ( main Scope , Ġoutput Container , Ġdependency Resolver ) ĊĊĠĠĠ Ġvisitor . visit ( parse Tree ) ĊĊĠĠĠ Ġreturn ĠMer it Execution Result ( output Container . output ()) ĊĠ Ġ} Ċ } Ċ