Author: coke
Date: Thu Nov 13 06:45:46 2008
New Revision: 32612
Modified:
trunk/languages/dotnet/build/builtins.pl
trunk/languages/dotnet/build/translator.pl
trunk/languages/dotnet/src/exception.pir
trunk/languages/dotnet/src/field.pir
trunk/languages/dotnet/src/internal.methods
trunk/languages/dotnet/src/method.pir
trunk/languages/dotnet/src/signature.pir
trunk/languages/dotnet/src/translation.rules
trunk/languages/dotnet/src/translator.pir
Log:
[dotnet] bare method names are [DEPRECATED]
This is just the build; more deprecation may be lurking in the test suite.
Modified: trunk/languages/dotnet/build/builtins.pl
==============================================================================
--- trunk/languages/dotnet/build/builtins.pl (original)
+++ trunk/languages/dotnet/build/builtins.pl Thu Nov 13 06:45:46 2008
@@ -35,7 +35,7 @@
.local string class_name, method_name, body
# Get class and method names.
- class_name = class.get_fullname()
+ class_name = class.'get_fullname'()
method_name = meth
PIR_OUT
Modified: trunk/languages/dotnet/build/translator.pl
==============================================================================
--- trunk/languages/dotnet/build/translator.pl (original)
+++ trunk/languages/dotnet/build/translator.pl Thu Nov 13 06:45:46 2008
@@ -447,8 +447,8 @@
NO_IN_TRACE:
# Get bytecode and initialize pc.
- bc = meth.get_bytecode()
- bc_length = bc.get_length()
+ bc = meth.'get_bytecode'()
+ bc_length = bc.'get_length'()
pc = 0
# Initialize stack types array.
@@ -486,7 +486,7 @@
# routine will jump back to TRANS_LOOP after translating the instruction.
$pir .= <<'PIRCODE';
# If we have exception handlers, need some intial stuff emitted.
- ehs = bc.get_eh()
+ ehs = bc.'get_eh'()
if null ehs goto NO_EH_HEADER
i = elements ehs
gen_pir = concat ".local pmc cur_exception\n"
@@ -500,7 +500,7 @@
# Translation loop.
ss_propogate = new 'Hash'
TRANS_LOOP:
- pc = bc.get_pos()
+ pc = bc.'get_pos'()
next_pc = pc
if pc >= bc_length goto COMPLETE
@@ -530,11 +530,11 @@
eh = ehs[i]
# If this is the start of a try block, emit a push_eh instruction.
- try_offset = eh.get_try_offset()
- try_length = eh.get_try_length()
+ try_offset = eh.'get_try_offset'()
+ try_length = eh.'get_try_length'()
if try_offset != pc goto NOT_TRY_START
gen_pir = concat "push_eh LAB"
- handler_offset = eh.get_handler_offset()
+ handler_offset = eh.'get_handler_offset'()
tmp = handler_offset
gen_pir = concat tmp
gen_pir = concat "\npushmark "
@@ -545,8 +545,8 @@
NOT_TRY_START:
# If this is the start of a typed exception handler...
- handler_offset = eh.get_handler_offset()
- eh_flags = eh.get_flags()
+ handler_offset = eh.'get_handler_offset'()
+ eh_flags = eh.'get_flags'()
if eh_flags != 0 goto NOT_TYPED_EH_START
if handler_offset != pc goto NOT_TYPED_EH_START
@@ -554,8 +554,8 @@
# is accepted.
gen_pir = concat ".get_results (cur_exception)\n"
gen_pir = concat "$P1000001 = cur_exception[\"obj\"]\n"
- class_type = eh.get_class_type()
- class_id = eh.get_class_id()
+ class_type = eh.'get_class_type'()
+ class_id = eh.'get_class_id'()
gen_pir = concat "$I1000000 = isa $P1000001, "
($P0, $S0) = class_info_from_ehtype(assembly, class_type, class_id)
$S0 = namespace_to_key($S0)
@@ -680,7 +680,7 @@
# rather than O(n).
my $pir = <<PIRCODE;
# Translation code dispatch table.
- cur_ic = bc.read_uint8()
+ cur_ic = bc.'read_uint8'()
next_pc += 1
PIRCODE
$pir .= binary_dispatch_table( '', @rules_grouped );
@@ -756,7 +756,7 @@
hex($x) <=> hex($1)
} @rules;
$pir .= "B2_BRANCH_$_:\n";
- $pir .= " cur_ic = bc.read_uint8()\n next_pc += 1\n";
+ $pir .= " cur_ic = bc.'read_uint8'()\n next_pc += 1\n";
$pir .= binary_dispatch_table( $_, @rules );
}
}
@@ -838,73 +838,73 @@
# uint8
if (/^uint8$/) {
- $out = " \${I_ARG_$arg_num} = bc.read_uint8()\n next_pc
+= 1\n";
+ $out = " \${I_ARG_$arg_num} = bc.'read_uint8'()\n
next_pc += 1\n";
$arg_name = "I_ARG_$arg_num";
}
# int8
elsif (/^int8$/) {
- $out = " \${I_ARG_$arg_num} = bc.read_int8()\n next_pc
+= 1\n";
+ $out = " \${I_ARG_$arg_num} = bc.'read_int8'()\n
next_pc += 1\n";
$arg_name = "I_ARG_$arg_num";
}
# uint16
elsif (/^uint16$/) {
- $out = " \${I_ARG_$arg_num} = bc.read_uint16()\n
next_pc += 2\n";
+ $out = " \${I_ARG_$arg_num} = bc.'read_uint16'()\n
next_pc += 2\n";
$arg_name = "I_ARG_$arg_num";
}
# int16
elsif (/^int16$/) {
- $out = " \${I_ARG_$arg_num} = bc.read_int16()\n next_pc
+= 2\n";
+ $out = " \${I_ARG_$arg_num} = bc.'read_int16'()\n
next_pc += 2\n";
$arg_name = "I_ARG_$arg_num";
}
# uint32
elsif (/^uint32$/) {
- $out = " \${I_ARG_$arg_num} = bc.read_uint32()\n
next_pc += 4\n";
+ $out = " \${I_ARG_$arg_num} = bc.'read_uint32'()\n
next_pc += 4\n";
$arg_name = "I_ARG_$arg_num";
}
# int32
elsif (/^int32$/) {
- $out = " \${I_ARG_$arg_num} = bc.read_int32()\n next_pc
+= 4\n";
+ $out = " \${I_ARG_$arg_num} = bc.'read_int32'()\n
next_pc += 4\n";
$arg_name = "I_ARG_$arg_num";
}
# float32
elsif (/^float32$/) {
- $out = " \${N_ARG_$arg_num} = bc.read_float32()\n
next_pc += 4\n";
+ $out = " \${N_ARG_$arg_num} = bc.'read_float32'()\n
next_pc += 4\n";
$arg_name = "N_ARG_$arg_num";
}
# float64
elsif (/^float64$/) {
- $out = " \${N_ARG_$arg_num} = bc.read_float64()\n
next_pc += 8\n";
+ $out = " \${N_ARG_$arg_num} = bc.'read_float64'()\n
next_pc += 8\n";
$arg_name = "N_ARG_$arg_num";
}
# tfield
elsif (/^tfield$/) {
- $out = " \${I_ARG_$arg_num} = bc.read_tfield()\n
next_pc += 4\n";
+ $out = " \${I_ARG_$arg_num} = bc.'read_tfield'()\n
next_pc += 4\n";
$arg_name = "I_ARG_$arg_num";
}
# tmethod
elsif (/^tmethod$/) {
- $out = " \${I_ARG_$arg_num} = bc.read_tmethod()\n
next_pc += 4\n";
+ $out = " \${I_ARG_$arg_num} = bc.'read_tmethod'()\n
next_pc += 4\n";
$arg_name = "I_ARG_$arg_num";
}
# ttype
elsif (/^ttype$/) {
- $out = " \${I_ARG_$arg_num} = bc.read_ttype()\n next_pc
+= 4\n";
+ $out = " \${I_ARG_$arg_num} = bc.'read_ttype'()\n
next_pc += 4\n";
$arg_name = "I_ARG_$arg_num";
}
# tstring
elsif (/^tstring$/) {
- $out = " \${I_ARG_$arg_num} = bc.read_tstring()\n
next_pc += 4\n";
+ $out = " \${I_ARG_$arg_num} = bc.'read_tstring'()\n
next_pc += 4\n";
$arg_name = "I_ARG_$arg_num";
}
@@ -912,13 +912,13 @@
elsif (/^jumptable$/) {
$out = <<"PIR";
\${P_ARG_$arg_num} = new "FixedPMCArray"
- i = bc.read_uint32()
+ i = bc.'read_uint32'()
next_pc += 4
\${P_ARG_$arg_num} = i
j = 0
JT_LOOP_$name:
if j == i goto JT_LOOP_END_$name
- \$I0 = bc.read_int32()
+ \$I0 = bc.'read_int32'()
next_pc += 4
\${P_ARG_$arg_num}[j] = \$I0
inc j
Modified: trunk/languages/dotnet/src/exception.pir
==============================================================================
--- trunk/languages/dotnet/src/exception.pir (original)
+++ trunk/languages/dotnet/src/exception.pir Thu Nov 13 06:45:46 2008
@@ -24,12 +24,12 @@
eh = ehs[i]
# Get info about handler.
- flags = eh.get_flags()
- try_start = eh.get_try_offset()
- try_length = eh.get_try_length()
+ flags = eh.'get_flags'()
+ try_start = eh.'get_try_offset'()
+ try_length = eh.'get_try_length'()
try_end = try_start + try_length
- handler_start = eh.get_handler_offset()
- handler_length = eh.get_handler_length()
+ handler_start = eh.'get_handler_offset'()
+ handler_length = eh.'get_handler_length'()
handler_end = handler_start + handler_length
# See if we've got to the block we're leaving for. If so, we know the
@@ -102,11 +102,11 @@
EH_LOOP:
if i >= num_handlers goto EH_LOOP_END
eh = ehs[i]
- flags = eh.get_flags()
+ flags = eh.'get_flags'()
if flags != 2 goto EH_LOOP_NEXT
- handler_start = eh.get_handler_offset()
+ handler_start = eh.'get_handler_offset'()
if pc < handler_start goto EH_LOOP_NEXT
- handler_length = eh.get_handler_length()
+ handler_length = eh.'get_handler_length'()
handler_end = handler_start + handler_length
if pc > handler_end goto EH_LOOP_NEXT
found = i
@@ -158,16 +158,16 @@
# A type in this file.
DEF:
dec class_id # Because row 2 = element 0 here, thanks to the global class
- classes = assembly.get_classes()
+ classes = assembly.'get_classes'()
pclass = classes[class_id]
- pclass_ns = pclass.get_fullname()
+ pclass_ns = pclass.'get_fullname'()
goto DONE
# A type in another file.
REF:
- classes = assembly.get_typerefs()
+ classes = assembly.'get_typerefs'()
pclass = classes[class_id]
- pclass_ns = pclass.get_namespace()
+ pclass_ns = pclass.'get_namespace'()
pclass_ns = clone pclass_ns
if pclass_ns == "" goto NO_NS
pclass_ns = concat "."
Modified: trunk/languages/dotnet/src/field.pir
==============================================================================
--- trunk/languages/dotnet/src/field.pir (original)
+++ trunk/languages/dotnet/src/field.pir Thu Nov 13 06:45:46 2008
@@ -16,20 +16,20 @@
# If we're here, it's an internal field. Get field name and signature.
field_id = band token, 0x1FFFFFF
- field = assembly.get_field(field_id)
- sig = field.get_signature()
- class = field.get_class()
- ns = class.get_fullname()
+ field = assembly.'get_field'(field_id)
+ sig = field.'get_signature'()
+ class = field.'get_class'()
+ ns = class.'get_fullname'()
goto DONE
# If we get here, it's an external field. Get member semantics PMC.
EXTERNAL:
field_id = band token, 0x1FFFFFF
dec field_id
- memberrefs = assembly.get_memberrefs()
+ memberrefs = assembly.'get_memberrefs'()
memberref = memberrefs[field_id]
- class_type = memberref.get_class_type()
- class_id = memberref.get_class_id()
+ class_type = memberref.'get_class_type'()
+ class_id = memberref.'get_class_id'()
dec class_id
if class_type == 1 goto TYPEREF
ex = new 'Exception'
@@ -38,9 +38,9 @@
# If we have a typeref, get it.
TYPEREF:
- typerefs = assembly.get_typerefs()
+ typerefs = assembly.'get_typerefs'()
class = typerefs[class_id]
- tmp = class.get_namespace()
+ tmp = class.'get_namespace'()
ns = clone tmp
if ns == "" goto NO_DOT
ns = concat "."
@@ -48,7 +48,7 @@
tmp = class
ns = concat tmp
field = memberref
- sig = memberref.get_signature()
+ sig = memberref.'get_signature'()
# Return stuff.
DONE:
Modified: trunk/languages/dotnet/src/internal.methods
==============================================================================
--- trunk/languages/dotnet/src/internal.methods (original)
+++ trunk/languages/dotnet/src/internal.methods Thu Nov 13 06:45:46 2008
@@ -3,7 +3,7 @@
[System.Object::InternalGetHashCode]
.param pmc obj
- $I0 = obj.__hash(42)
+ $I0 = obj.'__hash'(42)
.return($I0)
Modified: trunk/languages/dotnet/src/method.pir
==============================================================================
--- trunk/languages/dotnet/src/method.pir (original)
+++ trunk/languages/dotnet/src/method.pir Thu Nov 13 06:45:46 2008
@@ -14,14 +14,14 @@
.local int flags, impl_flags, static_check, abstract_check, runtime_check
# Check if method is static, abstract and/or runtime provided.
- flags = meth.get_flags()
- impl_flags = meth.get_impl_flags()
+ flags = meth.'get_flags'()
+ impl_flags = meth.'get_impl_flags'()
static_check = band flags, 0x10
abstract_check = band flags, 0x0400
runtime_check = band impl_flags, 0x1002 # Internal or runtime
# Get details of parameter info and multi-method dispatch markup.
- ns = class.get_fullname()
+ ns = class.'get_fullname'()
(rettype, ptypes, pir_params, pir_multi) = trans_method_params(assembly,
meth, ns)
# Emit top of method.
@@ -104,13 +104,13 @@
.local pmc rettype, ptypes, ptype
# Get signature.
- sig_pos = meth.get_signature()
- sig_data = assembly.get_blob(sig_pos)
+ sig_pos = meth.'get_signature'()
+ sig_data = assembly.'get_blob'(sig_pos)
signature = new "DotNetSignature"
signature = sig_data
# Get flags.
- flags = signature.read_uint8()
+ flags = signature.'read_uint8'()
# Check if it's a static method, has this specified explicitly or is
# var arg.
@@ -119,7 +119,7 @@
vararg_check = band flags, 0x7
# Get number of parameters.
- param_count = signature.read_compressed()
+ param_count = signature.'read_compressed'()
# Return type.
rettype = get_signature_RetType_or_Param(signature)
@@ -194,15 +194,15 @@
ex = "Unknown class type to build MMD signature for."
throw ex
MMD_CLASS_DEF:
- classes = assembly.get_classes()
+ classes = assembly.'get_classes'()
dec class_id
class = classes[class_id]
- tmp = class.get_fullname()
+ tmp = class.'get_fullname'()
tmp = namespace_to_key(tmp)
pir_multi = concat tmp
goto MMD_DONE
MMD_CLASS_REF:
- classes = assembly.get_typerefs()
+ classes = assembly.'get_typerefs'()
class = classes[class_id]
tmp = class
tmp = namespace_to_key(tmp)
@@ -260,15 +260,15 @@
ltypes = new 'ResizablePMCArray'
# Get signature.
- bc = meth.get_bytecode()
- sig_pos = bc.get_locals_sig()
+ bc = meth.'get_bytecode'()
+ sig_pos = bc.'get_locals_sig'()
if sig_pos == 0 goto EXIT
- sig_data = assembly.get_blob(sig_pos)
+ sig_data = assembly.'get_blob'(sig_pos)
signature = new "DotNetSignature"
signature = sig_data
# Ensure it's a local sig. XXX Right thing to do when it's not?
- sig_type = signature.read_uint8()
+ sig_type = signature.'read_uint8'()
if sig_type == 0x7 goto SIG_OK
ex = new 'Exception'
ex = "Locals signature is not a locals signature."
@@ -276,7 +276,7 @@
SIG_OK:
# Read locals count.
- count = signature.read_compressed()
+ count = signature.'read_compressed'()
# Loop over local variabless.
i = 0
@@ -338,9 +338,9 @@
# If we're here, it's an internal method. Get method PMC, namespace, parse
# its sig etc.
meth_id = band token, 0x1FFFFFF
- meth = assembly.get_method(meth_id)
- class = meth.get_class()
- ns = class.get_fullname()
+ meth = assembly.'get_method'(meth_id)
+ class = meth.'get_class'()
+ ns = class.'get_fullname'()
(rettype, ptypes, tmp) = trans_method_params(assembly, meth, ns)
goto DONE
@@ -348,10 +348,10 @@
EXTERNAL:
meth_id = band token, 0x1FFFFFF
dec meth_id
- memberrefs = assembly.get_memberrefs()
+ memberrefs = assembly.'get_memberrefs'()
memberref = memberrefs[meth_id]
- class_type = memberref.get_class_type()
- class_id = memberref.get_class_id()
+ class_type = memberref.'get_class_type'()
+ class_id = memberref.'get_class_id'()
dec class_id
if class_type == 1 goto TYPEREF
if class_type == 3 goto METHODDEF
@@ -361,9 +361,9 @@
# If we have a typeref, get it.
TYPEREF:
- typerefs = assembly.get_typerefs()
+ typerefs = assembly.'get_typerefs'()
class = typerefs[class_id]
- tmp = class.get_namespace()
+ tmp = class.'get_namespace'()
ns = clone tmp
if ns == "" goto NO_DOT
ns = concat "."
@@ -376,9 +376,9 @@
# If we have a methoddef, grab it.
METHODDEF:
- meth = assembly.get_method(class_id)
- class = meth.get_class()
- ns = class.get_fullname()
+ meth = assembly.'get_method'(class_id)
+ class = meth.'get_class'()
+ ns = class.'get_fullname'()
(rettype, ptypes, tmp) = trans_method_params(assembly, meth, ns)
goto DONE
@@ -484,16 +484,16 @@
# A type in this file.
DEF:
dec class_id # Because row 2 = element 0 here, thanks to the global class
- classes = assembly.get_classes()
+ classes = assembly.'get_classes'()
pclass = classes[class_id]
- pclass_ns = pclass.get_fullname()
+ pclass_ns = pclass.'get_fullname'()
goto DONE
# A type in another file.
REF:
- classes = assembly.get_typerefs()
+ classes = assembly.'get_typerefs'()
pclass = classes[class_id]
- pclass_ns = pclass.get_namespace()
+ pclass_ns = pclass.'get_namespace'()
pclass_ns = clone pclass_ns
if pclass_ns == "" goto NO_NS
pclass_ns = concat "."
Modified: trunk/languages/dotnet/src/signature.pir
==============================================================================
--- trunk/languages/dotnet/src/signature.pir (original)
+++ trunk/languages/dotnet/src/signature.pir Thu Nov 13 06:45:46 2008
@@ -18,7 +18,7 @@
GETDEFREF:
# Read type def or ref.
- type_def_or_ref = signature.read_compressed()
+ type_def_or_ref = signature.'read_compressed'()
# Return stuff.
.return (opt_req, type_def_or_ref)
@@ -35,7 +35,7 @@
ret = new 'Hash'
# Read type token.
- t1 = signature.read_compressed()
+ t1 = signature.'read_compressed'()
# First see if we have a custom modifier.
if t1 == 0x1F goto CMOD
@@ -43,12 +43,12 @@
goto NO_CMOD
CMOD:
(cmod_req, cmod_type_def_or_ref) = get_signature_CustomMod(signature, t1)
- t1 = signature.read_compressed()
+ t1 = signature.'read_compressed'()
NO_CMOD:
# If it's byref, we've got another one to read.
if t1 != 0x10 goto NORMALTYPE
- t2 = signature.read_compressed()
+ t2 = signature.'read_compressed'()
ret["type"] = t2
ret["byref"] = 1
goto TYPEREAD
@@ -61,7 +61,7 @@
type = ret["type"]
if type < 0x0F goto NOTOKEN
if type > 0x12 goto NOTOKEN
- token = signature.read_compressed()
+ token = signature.'read_compressed'()
ret["token"] = token
NOTOKEN:
@@ -106,7 +106,7 @@
# XXX We need to do stuff with these. Maybe.
# First token is always 6.
- t1 = signature.read_compressed()
+ t1 = signature.'read_compressed'()
if t1 == 6 goto NORMAL
ex = new 'Exception'
ex = "Expected a field signature, got something else."
@@ -114,7 +114,7 @@
NORMAL:
# Read type token.
- t1 = signature.read_compressed()
+ t1 = signature.'read_compressed'()
ret["type"] = t1
ret["byref"] = 0
@@ -122,7 +122,7 @@
type = ret["type"]
if type < 0x0F goto NOTOKEN
if type > 0x12 goto NOTOKEN
- token = signature.read_compressed()
+ token = signature.'read_compressed'()
ret["token"] = token
NOTOKEN:
@@ -163,18 +163,18 @@
ret = new 'Hash'
# Read type token.
- t1 = signature.read_compressed()
+ t1 = signature.'read_compressed'()
# There's a chance this won't be a type token, but rather a constraint.
# It can only be the pinned constraint.
if t1 != 0x45 goto NOTPINNED
ret["pinned"] = 1
- t1 = signature.read_compressed()
+ t1 = signature.'read_compressed'()
NOTPINNED:
# If it's byref, we've got another one to read.
if t1 != 0x10 goto NORMALTYPE
- t2 = signature.read_compressed()
+ t2 = signature.'read_compressed'()
ret["type"] = t2
ret["byref"] = 1
goto TYPEREAD
@@ -187,7 +187,7 @@
type = ret["type"]
if type < 0x0F goto NOTOKEN
if type > 0x12 goto NOTOKEN
- token = signature.read_compressed()
+ token = signature.'read_compressed'()
ret["token"] = token
NOTOKEN:
Modified: trunk/languages/dotnet/src/translation.rules
==============================================================================
--- trunk/languages/dotnet/src/translation.rules (original)
+++ trunk/languages/dotnet/src/translation.rules Thu Nov 13 06:45:46 2008
@@ -1563,7 +1563,7 @@
# Get signature.
${PTEMP1} = new "DotNetSignature"
-${STEMP0} = ${ASSEMBLY}.get_blob(${ITEMP0})
+${STEMP0} = ${ASSEMBLY}.'get_blob'(${ITEMP0})
${PTEMP1} = ${STEMP0}
# Parse signature, annotate it with register types and store it.
@@ -1602,7 +1602,7 @@
# Get signature.
${PTEMP1} = new "DotNetSignature"
-${STEMP0} = ${ASSEMBLY}.get_blob(${ITEMP0})
+${STEMP0} = ${ASSEMBLY}.'get_blob'(${ITEMP0})
${PTEMP1} = ${STEMP0}
# Parse signature, annotate it with register types and store it.
@@ -1758,18 +1758,18 @@
# External type. Get typeref token.
${ITEMP0} = band ${ARG0}, 0x00FFFFFF
dec ${ITEMP0} # Array starts at 0, meta-data table starts at 1.
-${PTEMP2} = ${ASSEMBLY}.get_typerefs()
+${PTEMP2} = ${ASSEMBLY}.'get_typerefs'()
${PTEMP3} = ${PTEMP2}[${ITEMP0}]
-${STEMP1} = ${PTEMP3}.get_namespace()
+${STEMP1} = ${PTEMP3}.'get_namespace'()
goto castclass_DONE_TYPE
# Internal type. Get class token.
castclass_INTERNAL_TYPE:
${ITEMP0} = band ${ARG0}, 0x01FFFFFF
${ITEMP0} -= 2
-${PTEMP2} = ${ASSEMBLY}.get_classes()
+${PTEMP2} = ${ASSEMBLY}.'get_classes'()
${PTEMP3} = ${PTEMP2}[${ITEMP0}]
-${STEMP1} = ${PTEMP3}.get_fullname()
+${STEMP1} = ${PTEMP3}.'get_fullname'()
castclass_DONE_TYPE:
# Generate two new labels.
@@ -1832,18 +1832,18 @@
# External type. Get typeref token.
${ITEMP0} = band ${ARG0}, 0x00FFFFFF
dec ${ITEMP0} # Array starts at 0, meta-data table starts at 1.
-${PTEMP2} = ${ASSEMBLY}.get_typerefs()
+${PTEMP2} = ${ASSEMBLY}.'get_typerefs'()
${PTEMP3} = ${PTEMP2}[${ITEMP0}]
-${STEMP1} = ${PTEMP3}.get_namespace()
+${STEMP1} = ${PTEMP3}.'get_namespace'()
goto isinst_DONE_TYPE
# Internal type. Get class token.
isinst_INTERNAL_TYPE:
${ITEMP0} = band ${ARG0}, 0x01FFFFFF
${ITEMP0} -= 2
-${PTEMP2} = ${ASSEMBLY}.get_classes()
+${PTEMP2} = ${ASSEMBLY}.'get_classes'()
${PTEMP3} = ${PTEMP2}[${ITEMP0}]
-${STEMP1} = ${PTEMP3}.get_fullname()
+${STEMP1} = ${PTEMP3}.'get_fullname'()
isinst_DONE_TYPE:
# Generate two new labels.
@@ -1907,7 +1907,7 @@
pop = 1
arguments = ttype
instruction = <<INS
-$P1000000 = ${STACK0}.load_pmc()
+$P1000000 = ${STACK0}.'load_pmc'()
$P1000000.__init()
INS
typeinfo = # None
@@ -1918,9 +1918,9 @@
pop = 2
arguments = ttype
instruction = <<INS
-$P1000000 = ${STACK0}.load_pmc()
+$P1000000 = ${STACK0}.'load_pmc'()
$P1000000 = clone $P1000000
-${STACK1}.store_pmc($P1000000)
+${STACK1}.'store_pmc'($P1000000)
INS
typeinfo = # None
@@ -1931,7 +1931,7 @@
push = 1
arguments = ttype
instruction = <<INS
-$P1000000 = ${STACK0}.load_pmc()
+$P1000000 = ${STACK0}.'load_pmc'()
${DEST0} = clone $P1000000
INS
typeinfo = <<PIR
@@ -2161,18 +2161,18 @@
# External type. Get typeref token.
${ITEMP0} = band ${ARG0}, 0x00FFFFFF
dec ${ITEMP0} # Array starts at 0, meta-data table starts at 1.
-${PTEMP2} = ${ASSEMBLY}.get_typerefs()
+${PTEMP2} = ${ASSEMBLY}.'get_typerefs'()
${PTEMP3} = ${PTEMP2}[${ITEMP0}]
-${STEMP1} = ${PTEMP3}.get_namespace()
+${STEMP1} = ${PTEMP3}.'get_namespace'()
goto unbox_DONE_TYPE
# Internal type. Get class token.
unbox_INTERNAL_TYPE:
${ITEMP0} = band ${ARG0}, 0x01FFFFFF
${ITEMP0} -= 2
-${PTEMP2} = ${ASSEMBLY}.get_classes()
+${PTEMP2} = ${ASSEMBLY}.'get_classes'()
${PTEMP3} = ${PTEMP2}[${ITEMP0}]
-${STEMP1} = ${PTEMP3}.get_fullname()
+${STEMP1} = ${PTEMP3}.'get_fullname'()
unbox_DONE_TYPE:
# Build new type info hash.
@@ -2300,7 +2300,7 @@
# External type. Get typeref token.
${ITEMP0} = band ${ARG0}, 0x00FFFFFF
dec ${ITEMP0} # Array starts at 0, meta-data table starts at 1.
-${PTEMP2} = ${ASSEMBLY}.get_typerefs()
+${PTEMP2} = ${ASSEMBLY}.'get_typerefs'()
${PTEMP3} = ${PTEMP2}[${ITEMP0}]
goto newarr_DONE_TYPE
@@ -2308,12 +2308,12 @@
newarr_INTERNAL_TYPE:
${ITEMP0} = band ${ARG0}, 0x01FFFFFF
dec ${ITEMP0} # Array starts at 0, meta-data table starts at 1.
-${PTEMP2} = ${ASSEMBLY}.get_classes()
+${PTEMP2} = ${ASSEMBLY}.'get_classes'()
${PTEMP3} = ${PTEMP2}[${ITEMP0}]
newarr_DONE_TYPE:
# See if we have a built-in type.
-${STEMP0} = ${PTEMP3}.get_namespace()
+${STEMP0} = ${PTEMP3}.'get_namespace'()
if ${STEMP0} != "System" goto newarr_OBJECT
# Get name of the built-in type and see if it's an integer or float.
@@ -2628,7 +2628,7 @@
arguments = tstring
pir = <<PIR
${ITEMP0} = band ${ARG0}, 0x0FFFFFFF
-${STEMP0} = ${ASSEMBLY}.get_user_string(${ITEMP0})
+${STEMP0} = ${ASSEMBLY}.'get_user_string'(${ITEMP0})
${STEMP2} = '"'
${STEMP1} = escaper(${STEMP0}, ${STEMP2})
${ITEMP0} = find_encoding "utf8"
@@ -2861,7 +2861,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_int()
+instruction = ${DEST0} = ${STACK0}.'load_int'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_I1
@@ -2875,7 +2875,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_int()
+instruction = ${DEST0} = ${STACK0}.'load_int'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_U1
@@ -2889,7 +2889,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_int()
+instruction = ${DEST0} = ${STACK0}.'load_int'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_I2
@@ -2903,7 +2903,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_int()
+instruction = ${DEST0} = ${STACK0}.'load_int'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_U2
@@ -2917,7 +2917,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_int()
+instruction = ${DEST0} = ${STACK0}.'load_int'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_I4
@@ -2931,7 +2931,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_pmc()
+instruction = ${DEST0} = ${STACK0}.'load_pmc'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_I8
@@ -2945,7 +2945,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_int()
+instruction = ${DEST0} = ${STACK0}.'load_int'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_U4
@@ -2959,7 +2959,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_int()
+instruction = ${DEST0} = ${STACK0}.'load_int'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_I
@@ -2973,7 +2973,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_float()
+instruction = ${DEST0} = ${STACK0}.'load_float'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_R4
@@ -2987,7 +2987,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_float()
+instruction = ${DEST0} = ${STACK0}.'load_float'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_R8
@@ -3001,7 +3001,7 @@
class = op
pop = 1
push = 1
-instruction = ${DEST0} = ${STACK0}.load_pmc()
+instruction = ${DEST0} = ${STACK0}.'load_pmc'()
typeinfo = <<PIR
${PTEMP0} = new "Hash"
${PTEMP0}["type"] = ELEMENT_TYPE_OBJECT
@@ -3014,56 +3014,56 @@
code = 51
class = op
pop = 2
-instruction = ${STACK1}.store_pmc(${STACK0})
+instruction = ${STACK1}.'store_pmc'(${STACK0})
typeinfo = # None
[stind.i1]
code = 52
class = op
pop = 2
-instruction = ${STACK1}.store_int(${STACK0})
+instruction = ${STACK1}.'store_int'(${STACK0})
typeinfo = # None
[stind.i2]
code = 53
class = op
pop = 2
-instruction = ${STACK1}.store_int(${STACK0})
+instruction = ${STACK1}.'store_int'(${STACK0})
typeinfo = # None
[stind.i4]
code = 54
class = op
pop = 2
-instruction = ${STACK1}.store_int(${STACK0})
+instruction = ${STACK1}.'store_int'(${STACK0})
typeinfo = # None
[stind.i8]
code = 55
class = op
pop = 2
-instruction = ${STACK1}.store_pmc(${STACK0})
+instruction = ${STACK1}.'store_pmc'(${STACK0})
typeinfo = # None
[stind.i]
code = DF
class = op
pop = 2
-instruction = ${STACK1}.store_int(${STACK0})
+instruction = ${STACK1}.'store_int'(${STACK0})
typeinfo = # None
[stind.r4]
code = 56
class = op
pop = 2
-instruction = ${STACK1}.store_float(${STACK0})
+instruction = ${STACK1}.'store_float'(${STACK0})
typeinfo = # None
[stind.r8]
code = 57
class = op
pop = 2
-instruction = ${STACK1}.store_float(${STACK0})
+instruction = ${STACK1}.'store_float'(${STACK0})
typeinfo = # None
Modified: trunk/languages/dotnet/src/translator.pir
==============================================================================
--- trunk/languages/dotnet/src/translator.pir (original)
+++ trunk/languages/dotnet/src/translator.pir Thu Nov 13 06:45:46 2008
@@ -19,7 +19,7 @@
# Set filename and attempt to load.
assembly = filename
- assembly.load()
+ assembly.'load'()
# Load the escaper library, which we will be using.
load_bytecode "library/Data/Escape.pir"
@@ -144,8 +144,8 @@
# XXX TODO: Translate globals.
# Translate each class according to the ordering.
- classes = assembly.get_classes()
- class_order = assembly.get_class_order()
+ classes = assembly.'get_classes'()
+ class_order = assembly.'get_class_order'()
max_class = elements classes
i = 0
total_types = 0
@@ -183,10 +183,10 @@
is_dll = assembly."is_dll"()
if is_dll > 0 goto ISEXE
src = pir_output
- entry_meth = assembly.get_entry_method()
- entry_class = entry_meth.get_class()
+ entry_meth = assembly.'get_entry_method'()
+ entry_class = entry_meth.'get_class'()
pir_output = ".sub __ENTRY_POINT\n__DO_IMPORTS()\n$P0 = get_hll_global \""
- tmp = entry_class.get_fullname()
+ tmp = entry_class.'get_fullname'()
pir_output = concat tmp
pir_output = concat "\", \""
tmp = entry_meth
@@ -223,7 +223,7 @@
pir_output = ".sub __DO_IMPORTS :load\n"
# Loop over assembly refs.
- assrefs = assembly.get_assemblyrefs()
+ assrefs = assembly.'get_assemblyrefs'()
assref_count = elements assrefs
i = 0
AR_LOOP:
@@ -258,8 +258,8 @@
# Get class name and namespace and build combo of them.
name = class
- namespace = class.get_namespace()
- internal_name = class.get_fullname()
+ namespace = class.'get_namespace'()
+ internal_name = class.'get_fullname'()
# Emit trace message.
unless trace goto NOTRACE
@@ -283,8 +283,8 @@
pir_output = concat "\n"
# Add any interfaces that this class implements.
- int_types = class.get_interface_types()
- int_ids = class.get_interface_ids()
+ int_types = class.'get_interface_types'()
+ int_ids = class.'get_interface_ids'()
num_interfaces = elements int_types
i = 0
INT_LOOP:
@@ -298,16 +298,16 @@
END_INT_LOOP:
# Inherit the parent class. Note System.Object has ID 0, and jump over
this stuff.
- parent_id = class.get_parent_id()
+ parent_id = class.'get_parent_id'()
if parent_id == 0 goto NO_PARENT
dec parent_id
- parent_type = class.get_parent_type()
+ parent_type = class.'get_parent_type'()
(tmp, p_name) = add_parent(assembly, parent_type, parent_id)
pir_output = concat tmp
NO_PARENT:
# Emit field list.
- fields = class.get_fields()
+ fields = class.'get_fields'()
max_field = elements fields
i = 0
FLOOP:
@@ -330,7 +330,7 @@
pir_output = concat "FAILED:\n.end\n\n"
# If it's an interface, emit code to prevent it being instantiated.
- flags = class.get_flags()
+ flags = class.'get_flags'()
is_interface = band flags, 0x20
if is_interface == 0 goto NOT_INTERFACE
pir_output = concat <<"PIR"
@@ -384,7 +384,7 @@
NOT_VAL_TYPE:
# Emit methods.
- methods = class.get_methods()
+ methods = class.'get_methods'()
max_method = elements methods
i = 0
MLOOP:
@@ -420,18 +420,18 @@
# Parent may be a type in this file.
PARENT_DEF:
dec parent_id # Because row 2 = element 0 here, thanks to the global class
- classes = assembly.get_classes()
+ classes = assembly.'get_classes'()
pclass = classes[parent_id]
- pclass_ns = pclass.get_fullname()
+ pclass_ns = pclass.'get_fullname'()
pclass_ns = namespace_to_key(pclass_ns)
pir_output = concat pclass_ns
goto PARENT_DONE
# Parent may be a type in another file.
PARENT_REF:
- classes = assembly.get_typerefs()
+ classes = assembly.'get_typerefs'()
pclass = classes[parent_id]
- pclass_ns = pclass.get_namespace()
+ pclass_ns = pclass.'get_namespace'()
pclass_ns = clone pclass_ns
if pclass_ns == "" goto PARENT_NO_NS
pclass_ns = concat "."
@@ -457,7 +457,7 @@
.local string pir_output, name
# Check it's an instance field.
- flags = field.get_flags()
+ flags = field.'get_flags'()
static = band flags, 0x10
if static != 0 goto STATIC
@@ -495,7 +495,7 @@
# The __init method needs to zero or null out any attributes.
# The __clone method needs to clone each attribute.
- fields = class.get_fields()
+ fields = class.'get_fields'()
i = elements fields
init_body = ""
clone_body = ""
@@ -505,7 +505,7 @@
field = fields[i]
# Skip if field is static.
- flags = field.get_flags()
+ flags = field.'get_flags'()
static = band flags, 0x10
if static != 0 goto ILOOP
@@ -518,8 +518,8 @@
clone_body = concat "\", $P0\n"
# Need to look at signature to initialize attributes by type.
- sig_id = field.get_signature()
- sig_data = assembly.get_blob(sig_id)
+ sig_id = field.'get_signature'()
+ sig_data = assembly.'get_blob'(sig_id)
sig = new "DotNetSignature"
sig = sig_data
sig_info = get_signature_Field(sig)