]> nuage.metani.fr Git - 3GPP.git/blobdiff - awk/txt2asn-integrated.awk
txt2asn-integrated: Usable on GNU/Linux, still needs cygwin checking.
[3GPP.git] / awk / txt2asn-integrated.awk
index 407715431fca2c5fd90eee092ccbd24834ca40f2..061f8f376f67440c3ce81065b83a60ecb516be7f 100755 (executable)
@@ -137,11 +137,21 @@ BEGIN {
 
 }
 
-/^[0-9]+\./ {
+/^[0-9]+(\.[0-9]+)*\t/ {
     if (in_IE == "yes") {  asn1_print(); }
     in_IE = "no" ;
 }
 
+/^[A-Za-z0-9-]+ message$/ {
+    # No need to print this
+    next;
+}
+
+/^[A-Za-z0-9-]+ information element$/ {
+    # No need to print this
+    next;
+}
+
 /^-- ASN1START/ {
     print "";
     in_ASN1 = "yes";
@@ -152,6 +162,7 @@ BEGIN {
 
 /^-- ASN1STOP/ {
     in_ASN1 = "no";
+    direct_print = "no" ;
     next;
 }
 
@@ -168,7 +179,9 @@ BEGIN {
         #print separator ;
      }
      
-     next_line = "" ;
+     if (next_line != "field description") {
+        next_line = "" ;
+     }
 #     #if (empty_line == "yes") {
 #       next;
 #     }
@@ -197,11 +210,11 @@ BEGIN {
     
 }
 
-/^[[:space:]]+ParentIE-WithEM$/ {
+/^-[[:space:]]+ParentIE-WithEM$/ {
     exit 0 ;
 }
 
-/^[[:space:]]+[A-Za-z0-9-]+$/ {
+/^-[[:space:]]+[A-Za-z0-9-]+$/ {
     asn1_print();
 
 #    if (empty_line == "yes") {
@@ -220,6 +233,51 @@ BEGIN {
     next ;
 }
 
+/^-[[:space:]]+Multiplicity and type constraints? definitions?$/ {
+
+    #print "Trouvé" ;
+    if (in_IE == "yes") {
+       asn1_print();
+    }
+    in_IE = "yes" ;
+    #print "Trouvé 2" ;
+
+    # In this case, directly print ASN.1 without processing
+    direct_print = "yes" ;
+    
+    print ie_separator;
+    print "-- IE: Constants";
+    print "" ;
+    empty_line = "no" ;
+    conditions = "" ;
+
+    next ;
+}
+
+/^-[[:space:]]+End of [A-Za-z0-9-]+$/ {
+    if (in_IE == "yes") {
+       asn1_print();
+    }
+    in_IE = "yes" ;
+    empty_line = "no" ;
+    conditions = "" ;
+}
+
+/^NR-InterNodeDefinitions/ {
+    
+    print ie_separator;
+    print "-- IE: NR-InterNodeDefinitions";
+    print "" ;
+    print ;
+    
+    empty_line = "no" ;
+    conditions = "" ;
+
+    in_IE = "no" ;
+    direct_print = "yes" ;
+    next ;
+}
+
 /^Conditional [Pp]resence/ {
     add_line_after = "";
     separator = "" ;
@@ -263,7 +321,7 @@ BEGIN {
 #}
 
 # This is matched for any non-empty line
-/^[A-Za-z0-9-]+/ {
+/[A-Za-z0-9-]+/ {
 
     
     if ((in_IE == "yes") && (in_ASN1 == "no")){
@@ -338,6 +396,11 @@ BEGIN {
            }
        }   
     }
+
+    else if ((in_ASN1 == "yes") && (direct_print == "yes")) {
+       print ;
+       next ;
+    }
 }
 
 #/^[A-Za-z0-9-]+/ {
@@ -406,7 +469,11 @@ BEGIN {
                if((line_number==0) && (/^[[:space:]]*$/)) { next ; }
                line_number++;
                text[line_number] = $0;
-               
+
+               if (/Multiplicity/) {
+                   print "Trouvé 3";
+                   print $0;
+               }
                #print "text[" line_number "] est " text[line_number];
                if (/^[A-Za-z0-9-]+[[:space:]]+:/) {
                    # remove suffix
@@ -482,6 +549,9 @@ BEGIN {
        if (/-- Cond [A-Za-z0-9_-]+$/) {
            conditions = conditions " " $NF ;
        }
-    }  
+    }
+    else if ((in_ASN1 == "yes") && (direct_print == "yes")) {
+       print ;
+    }
 }