Fix processing of TIME literals (submited by Andreas)
authorMario de Sousa <msousa@fe.up.pt>
Thu, 25 Oct 2012 12:39:01 +0100
changeset 686 9b87606d4c07
parent 685 5b19e376cc94
child 687 81dcb3987cbb
Fix processing of TIME literals (submited by Andreas)
stage1_2/iec_flex.ll
stage3/forced_narrow_candidate_datatypes.cc
--- a/stage1_2/iec_flex.ll	Thu Oct 25 12:05:31 2012 +0100
+++ b/stage1_2/iec_flex.ll	Thu Oct 25 12:39:01 2012 +0100
@@ -728,9 +728,9 @@
  */
 
 interval_ms_X		({integer_0_999}(\.{integer})?)ms
-interval_s_X		{integer_0_59}s(_?{interval_ms_X})?
-interval_m_X		{integer_0_59}m(_?{interval_s_X})?
-interval_h_X		{integer_0_23}h(_?{interval_m_X})?
+interval_s_X		{integer_0_59}s(_?{interval_ms_X})?|({integer_0_59}(\.{integer})?s)
+interval_m_X		{integer_0_59}m(_?{interval_s_X})?|({integer_0_59}(\.{integer})?m)
+interval_h_X		{integer_0_23}h(_?{interval_m_X})?|({integer_0_23}(\.{integer})?h)
 
 interval_ms		{integer}ms|({fixed_point}ms)
 interval_s		{integer}s(_?{interval_ms_X})?|({fixed_point}s)
@@ -740,6 +740,7 @@
 
 interval		{interval_ms}|{interval_s}|{interval_m}|{interval_h}|{interval_d}
 
+
 /* to help provide nice error messages, we also parse an incorrect but plausible interval... */
 /* NOTE that this erroneous interval will be parsed outside the time_literal_state, so must not 
  *      be able to parse any other legal lexcial construct (besides a legal interval, but that
--- a/stage3/forced_narrow_candidate_datatypes.cc	Thu Oct 25 12:05:31 2012 +0100
+++ b/stage3/forced_narrow_candidate_datatypes.cc	Thu Oct 25 12:39:01 2012 +0100
@@ -149,6 +149,10 @@
       ERROR;
   }
   */
+printf("\n\n result of forced_narrow...\n");
+print_ast_c::print(symbol);
+// for(int i = 0; i < symbol->n; i++)  print_symbol_c::print(symbol->elements[i]);
+  
   return NULL;
 }