generated from rnentjes/kotlin-server-web-undertow
Remove legacy JVM-specific file system, shell, and related implementations; migrate to platform-agnostic and common main modules.
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
package mtmc.asm.instructions
|
||||
|
||||
import mtmc.asm.Assembler
|
||||
import mtmc.tokenizer.MTMCToken
|
||||
|
||||
class MetaInstruction(instruction: MTMCToken) :
|
||||
Instruction(InstructionType.META, listOf(), instruction) {
|
||||
private var originalFilePath: MTMCToken? = null
|
||||
private var originaLineNumber: MTMCToken? = null
|
||||
private var globalName: MTMCToken? = null
|
||||
private var globalLocation: MTMCToken? = null
|
||||
private var globalType: MTMCToken? = null
|
||||
private var localName: MTMCToken? = null
|
||||
private var localOffset: MTMCToken? = null
|
||||
private var localType: MTMCToken? = null
|
||||
|
||||
override fun genCode(output: ByteArray, assembler: Assembler) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
val isFileDirective: Boolean
|
||||
get() = "file" == this.instructionToken.stringValue
|
||||
|
||||
val isLineDirective: Boolean
|
||||
get() = "line" == this.instructionToken.stringValue
|
||||
|
||||
val isGlobalDirective: Boolean
|
||||
get() = "global" == this.instructionToken.stringValue
|
||||
|
||||
val isLocalDirective: Boolean
|
||||
get() = "local" == this.instructionToken.stringValue
|
||||
|
||||
val isEndLocalDirective: Boolean
|
||||
get() = "endlocal" == this.instructionToken.stringValue
|
||||
|
||||
fun setOriginalFilePath(path: MTMCToken) {
|
||||
this.originalFilePath = path
|
||||
}
|
||||
|
||||
fun setOriginalLineNumber(lineNumber: MTMCToken) {
|
||||
this.originaLineNumber = lineNumber
|
||||
}
|
||||
|
||||
val originalLineNumber: Int
|
||||
get() = this.originaLineNumber!!.intValue()
|
||||
|
||||
fun setGlobalInfo(name: MTMCToken, location: MTMCToken, type: MTMCToken) {
|
||||
this.globalName = name
|
||||
this.globalLocation = location
|
||||
this.globalType = type
|
||||
}
|
||||
|
||||
fun setLocalInfo(name: MTMCToken, offset: MTMCToken, type: MTMCToken) {
|
||||
this.localName = name
|
||||
this.localOffset = offset
|
||||
this.localType = type
|
||||
}
|
||||
|
||||
fun setEndLocalInfo(name: MTMCToken) {
|
||||
this.localName = name
|
||||
}
|
||||
|
||||
fun getOriginalFilePath(): String? {
|
||||
return this.originalFilePath!!.stringValue
|
||||
}
|
||||
|
||||
fun getGlobalName(): String? {
|
||||
return this.globalName!!.stringValue
|
||||
}
|
||||
|
||||
fun getGlobalLocation(): Int {
|
||||
return this.globalLocation!!.intValue()
|
||||
}
|
||||
|
||||
fun getGlobalType(): String? {
|
||||
return this.globalType!!.stringValue
|
||||
}
|
||||
|
||||
fun getLocalName(): String? {
|
||||
return this.localName!!.stringValue
|
||||
}
|
||||
|
||||
fun getLocalOffset(): Int {
|
||||
return this.localOffset!!.intValue()
|
||||
}
|
||||
|
||||
fun getLocalType(): String? {
|
||||
return this.localType!!.stringValue
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user