스칼라에서 프로그램을 실행하는 데 문제가 있습니다. 나는 언어에 아주 익숙하고 intellij에서 설정할 수 없었기 때문에 지금은 숭고하고 터미널에서 실행하려고합니다. microproject 클래스를 실행하려고하면 arrayindexoutofbounds 오류가 계속 발생합니다.스칼라 프로그램 실행
누군가 내게 큰이 프로그램을 실행하는 방법을 알아내는 데 도움 주시기 바랍니다 수 있습니다.
import scala.util.parsing.combinator._
abstract class MatchTree
case class S(e:MatchTree) extends MatchTree
case class E(c:MatchTree, e:MatchTree) extends MatchTree
case class C(s:String) extends MatchTree
case class NIL() extends MatchTree
class MPParser extends JavaTokenParsers{
def s: Parser[MatchTree] = e ^^ {case se => S(se)}
def e: Parser[MatchTree] = c ~ e ^^ {case ch ~ ex => E(ch,ex)} | c ^^ {case
ch => E(ch,NIL())}
def c[C] = ("a" | "b") ^^ {case ch => C(ch)}
}
object Microproject extends MPParser{
def main(args: Array[String]) {
println("input : "+ args(0))
println(parseAll(s, args(0)))
}
}
프로그램을 실행하는 데 성공한 것 같습니다. 프로그램 작동 여부는 또 다른 문제입니다. – byxor
내 선생님 코드 – Demuze28