Skip to content
Browse files

Add PACT.Packfile

This is a basic framework and is likely to be expanded as it gets
used.
  • Loading branch information...
1 parent 63c9bcb commit 869a191ed7ffc236ba79e2fe0d8ffec899e4a878 @Benabik Benabik committed Jun 26, 2012
Showing with 111 additions and 0 deletions.
  1. +104 −0 pact/packfile.winxed
  2. +7 −0 setup.winxed
View
104 pact/packfile.winxed
@@ -0,0 +1,104 @@
+namespace PACT.Packfile {
+ class Packfile {
+ // Constants
+ var floats; // RFA
+ var pmcs; // RPA
+ var strings; // RSA
+
+ // Root namespace
+ var root; // Namespace
+
+ // Main sub
+ var main; // Subroutine
+
+ // Opcode libraries
+ var oplibs; // RSA
+
+ // Functions similar to PackfileView
+ }
+
+ class Namespace {
+ var name; // String
+ var contents; // Hash
+
+ // Should act hash-like
+ }
+
+ class Constant {
+ var value;
+ var type; // Integer
+
+ // init and set from all types
+ }
+
+ namespace Constant {
+ // A reference to something in the constants table
+ class Reference : Constant {
+ // uses value as an index into a table
+ var packfile; // needs this for lookups
+
+ // dereference
+ }
+
+ class Key : Constant {
+ // value is an RPA used to build a Key PMC
+
+ // convert to/from Key
+ }
+ }
+
+ // Below are found in Namespace.contents
+
+ class Subroutine {
+ var name; // String
+ var ops; // RPA
+ var flags; // Hash
+ var multi_sig; // FPA or null
+
+ // argument information, all Integers
+ var positional_required;
+ var positional_optional;
+ var positional_slurpy;
+ var named_required;
+ var named_optional;
+ var named_slurpy;
+
+ // Registers used
+ var registers; // FIA, ordered based on type flag
+ }
+
+ class Multi {
+ var name; // String
+ var canidates; // RPA
+ }
+
+ // Below are in Subroutine.ops
+
+ class Op {
+ var name; // String
+ var pc; // Integer
+ var line; // Integer, for debug segment
+ var args; // RPA
+ }
+
+ class Label {
+ var name; // String
+ var pc; // Integer
+ }
+
+ class Register {
+ var type; // Integer, from call_bits
+ var number; // Integer
+ }
+
+ class Annotation {
+ var name; // String
+ var value; // Constant
+ var pc; // Integer
+ }
+
+ class Debug {
+ var filename; // String
+ var pc; // Integer
+ }
+}
View
7 setup.winxed
@@ -17,6 +17,12 @@ function installable_winxed(var pact, string name, string prefix) {
pact['installable_pbc'][name] = prefix+'.pbc';
}
+// Create an installable library from winxed
+function library_winxed(var pact, string prefix) {
+ pbc_winxed(pact, prefix);
+ push(pact['inst_lib'], prefix+'.pbc');
+}
+
function main[main](var argv) {
int exit_code = 0;
@@ -43,6 +49,7 @@ function main[main](var argv) {
'installable_pbc' : {}
};
+ pbc_winxed(pact, 'pact/packfile');
installable_winxed(pact, 'pact_disasm', 'src/disasm');
// Invoke distutils

0 comments on commit 869a191

Please sign in to comment.
Something went wrong with that request. Please try again.