All Downloads are FREE. Search and download functionalities are using the official Maven repository.

parsley.internal.machine.stacks.CallStack.scala Maven / Gradle / Ivy

The newest version!
/*
 * Copyright 2020 Parsley Contributors 
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */
package parsley.internal.machine.stacks

import parsley.internal.machine.instructions.Instr

private [machine] final class CallStack(val ret: Int, val instrs: Array[Instr], val callId: Int, val tail: CallStack)
private [machine] object CallStack extends Stack[CallStack] {
    implicit val inst: Stack[CallStack] = this
    type ElemTy = (Int, Array[Instr])
    // $COVERAGE-OFF$
    override protected def show(x: ElemTy): String = x._1.toString
    override protected def head(xs: CallStack): ElemTy = (xs.ret, xs.instrs)
    override protected def tail(xs: CallStack): CallStack = xs.tail
    // $COVERAGE-ON$
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy