Author: kjs
Date: Sat Jan 3 06:45:47 2009
New Revision: 34880
Modified:
trunk/compilers/pirc/new/pirsymbol.c
Log:
[pirc] clarification of value-type-to-pir-type stuff.
Modified: trunk/compilers/pirc/new/pirsymbol.c
==============================================================================
--- trunk/compilers/pirc/new/pirsymbol.c (original)
+++ trunk/compilers/pirc/new/pirsymbol.c Sat Jan 3 06:45:47 2009
@@ -271,8 +271,25 @@
while (subiter != lexer->subs->next); /* iterate over all subs */
}
+/* Lookup table to convert value_type values into pir_type values.
+ * when indexing with a pir_type value, the pir_type value itself
+ * is returned; when looking up with a value_type, the corresponding
+ * pir_type value is returned. For instance, for both STRING_VAL and
+ * USTRING_VAL, STRING_TYPE is returned.
+ */
+static const int convert_valuetype_to_pirtype[10] = {
+ INT_TYPE,
+ STRING_TYPE,
+ PMC_TYPE,
+ NUM_TYPE,
+ UNKNOWN_TYPE,
+ INT_TYPE, /* INT_VAL -> INT_TYPE */
+ STRING_TYPE, /* STRING_VAL -> STRING_TYPE */
+ PMC_TYPE, /* PMC_VAL -> PMC_TYPE */
+ NUM_TYPE, /* NUM_VAL -> NUM_TYPE */
+ STRING_TYPE /* USTRING_VAL -> STRING_TYPE */
+};
-static const int convert_valuetype_to_pirtype[10] = {0,1,2,3,4,0,1,2,3,1};
/*
=item C<symbol *