Merge pull request #51 from BenceJanosSzabo/master
authorElemer Lelik <erititan@users.noreply.github.com>
Wed, 27 Apr 2016 09:12:06 +0000 (11:12 +0200)
committerElemer Lelik <erititan@users.noreply.github.com>
Wed, 27 Apr 2016 09:12:06 +0000 (11:12 +0200)
Added any2unistr (artf724008)

1  2 
compiler2/ttcn3/compiler.y

index 1ea0985ad22e5ecdadf09fb5d2fb1a072afb4c31,32ce893a1c8951b469cb79139a61e4f15f0f4f69..435af7d73994973088bc1d32eb46be5546c6b36d
@@@ -834,6 -834,7 +834,7 @@@ static const string anyname("anytype")
  %token decode_base64KeyWord
  %token encvalue_unicharKeyWord
  %token decvalue_unicharKeyWord
+ %token any2unistrKeyWord
  
  /* Multi-character operators */
  
@@@ -5556,7 -5557,7 +5557,7 @@@ DisconnectStatement: // 33
    }
  | DisconnectKeyword SingleOrMultiConnectionSpec
    {
 -    if ($2.compref1 && $2.portref1 && $2.compref1 && $2.compref2) {
 +    if ($2.portref1 && $2.portref2 && $2.compref1 && $2.compref2) {
        $$ = new Statement(Statement::S_DISCONNECT,
        $2.compref1, $2.portref1, $2.compref2, $2.portref2);
      } else {
@@@ -8726,6 -8727,20 +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.030621 seconds and 5 git commands to generate.