Merge pull request #51 from BenceJanosSzabo/master
[deliverable/titan.core.git] / compiler2 / ttcn3 / compiler.y
index 1ea0985ad22e5ecdadf09fb5d2fb1a072afb4c31..435af7d73994973088bc1d32eb46be5546c6b36d 100644 (file)
@@ -834,6 +834,7 @@ static const string anyname("anytype");
 %token decode_base64KeyWord
 %token encvalue_unicharKeyWord
 %token decvalue_unicharKeyWord
+%token any2unistrKeyWord
 
 /* Multi-character operators */
 
@@ -8726,6 +8727,20 @@ PredefinedOps:
     $$ = new Value(Value::OPTYPE_LOG2STR, new LogArguments());
     $$->set_location(infile, @$);
   }
+| any2unistrKeyWord '(' LogItemList optError ')'
+  {
+    if ($3->get_nof_logargs() != 1) {
+      Location loc(infile, @1);
+      loc.error("The any2unistr function takes exactly one argument, not %lu.",
+        $3->get_nof_logargs());
+        delete $3;
+        $$ = new Value(Value::OPTYPE_ANY2UNISTR, new LogArguments());
+        $$->set_location(infile, @$);
+    } else {
+      $$ = new Value(Value::OPTYPE_ANY2UNISTR, $3);
+      $$->set_location(infile, @$);
+    }
+  }
 | testcasenameKeyword '(' ')'
   {
     $$ = new Value(Value::OPTYPE_TESTCASENAME);
This page took 0.024494 seconds and 5 git commands to generate.