File: instr.go

package info (click to toggle)
mtail 3.2.24-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,384 kB
  • sloc: yacc: 647; makefile: 226; sh: 78; lisp: 77; awk: 17
file content (18 lines) | stat: -rw-r--r-- 508 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// Copyright 2011 Google Inc. All Rights Reserved.
// This file is available under the Apache license.

// Package code contains the bytecode instructions for the mtail virtual machine.
package code

import "fmt"

type Instr struct {
	Opcode     Opcode
	Operand    interface{}
	SourceLine int // Line number of the original source file, zero-based numbering.
}

// debug print for instructions.
func (i Instr) String() string {
	return fmt.Sprintf("{%s %v %d}", opNames[i.Opcode], i.Operand, i.SourceLine)
}