Skip to content

Commit 639007d

Browse files
committed
Remove C/Scala stubs from python stg files
1 parent f50e924 commit 639007d

4 files changed

Lines changed: 6 additions & 31 deletions

File tree

StgPython/acn_python.stg

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -827,20 +827,12 @@ if not decoded_result.success or decoded_result.decoded_value is None:
827827
<if(bFixedSize)><p> = <sTypeDefName>(arr=<p>_arr)<else><p> = <sTypeDefName>(nCount=decoded_result.bits_consumed, arr=<p>_arr)<endif>
828828
>>
829829

830-
RefTypeParam_tmpVar(sName, sTypeDecl) ::= "<sTypeDecl> <sName>"
830+
RefTypeParam_tmpVar(sName, sTypeDecl) ::= ""
831831

832832
ReferenceType1_encode(p, sName, bAcnEncodeFuncRequiresResult, arrsArgs, arrsLocalPrms) ::= <<
833-
<arrsLocalPrms, arrsArgs: {lp,arg|<if(arg)><lp> = <arg>;// 3031<endif>}; separator="\n">
834-
res = <sName>_ACN_Encode(<p>, codec, pErrCode, FALSE<if(arrsArgs)>, <arrsLocalPrms; separator=", "><endif>)
835-
if not res:
836-
return res
837833
>>
838834

839835
ReferenceType1_decode(p, sName, bAcnEncodeFuncRequiresResult, arrsArgs, arrsLocalPrms) ::= <<
840-
<arrsLocalPrms, arrsArgs: {lp,arg|<if(arg)><lp> = <arg>; // 3030<endif>}; separator="\n">
841-
res = <sName>_ACN_Decode(<p>, codec, pErrCode<if(arrsArgs)>, <arrsLocalPrms; separator=", "><endif>)
842-
if not res:
843-
return res
844836
>>
845837

846838

@@ -1315,20 +1307,7 @@ codec.append_bits(arr, int(<sExtField>))
13151307
>>
13161308

13171309
bit_string_containing_ext_field_func_decode(p, sFuncName, sReqBytesForUperEncoding, sReqBitsForUperEncoding, sExtField, sErrCode) ::= <<
1318-
# TODO: open new scope to declare some variables
1319-
1320-
# decode to a temporary bitstream
1321-
bitStrm: BitStream = BitStream_Init(<sReqBytesForUperEncoding>)
1322-
if int(<sExtField>) \<= <sReqBitsForUperEncoding>:
1323-
match codec.read_bits((int)<sExtField>):
1324-
case NoneMut():
1325-
return Asn1ConstraintValidResult(is_valid=False, error_code=<sErrCode>)
1326-
case SomeMut(arr):
1327-
bitStrm.buf = arr
1328-
1329-
res = <sFuncName>(<p>, bitStrm)
1330-
if not res:
1331-
return res
1310+
#INVALID FOR PYTHON
13321311
>>
13331312

13341313
rtlModuleName() ::= ""

StgPython/header_python.stg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ Python TYPES
5353

5454
Declare_Integer() ::="int"
5555
Declare_PosInteger() ::="int"
56-
Declare_IntegerNoRTL() ::="LongNoRTL" // TODO
57-
Declare_PosIntegerNoRTL() ::="ULongNoRTL" // TODO
56+
Declare_IntegerNoRTL() ::="int"
57+
Declare_PosIntegerNoRTL() ::="int"
5858

5959
Declare_Boolean() ::= "Asn1Boolean"
6060
Declare_Real() ::= "float"
@@ -253,7 +253,7 @@ class <td.typeName>(<prTd.typeName>):
253253

254254
/*********************************** SEQUENCE ************************************************************/
255255

256-
Define_new_sequence_child_bit(sName) ::= "<sName>: Boolean"
256+
Define_new_sequence_child_bit(sName) ::= "#INVALID FOR PYTHON"
257257

258258
Define_new_sequence_child(sName, sType, bIsOptional) ::= <<
259259
<if (bIsOptional)>
@@ -263,7 +263,7 @@ Define_new_sequence_child(sName, sType, bIsOptional) ::= <<
263263
<endif>
264264
>>
265265

266-
Define_new_sequence_save_pos_child(td/*:FE_SequenceTypeDefinition*/, sName, nMaxBytesInACN) ::= "BitStream <sName>"
266+
Define_new_sequence_save_pos_child(td/*:FE_SequenceTypeDefinition*/, sName, nMaxBytesInACN) ::= "#INVALID FOR PYTHON"
267267

268268
Define_new_sequence(td/*:FE_SequenceTypeDefinition*/, arrsChildren, arrsOptionalChildren, arrsChildrenDefinitions, arrsNullFieldsSavePos, arrsSizeDefinition, arrsInvariants, arr_Asn1Encoding) ::= <<
269269
# -- <td.typeName> --------------------------------------------

StgPython/isvalid_python.stg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,6 @@ alphaFuncNameWithIndex(p, nIdx) ::= "chars_are_valid_<nIdx>"
232232
PrintMultipleConstraints(arrsConstraints) ::= "<arrsConstraints; separator=\" and \">"
233233

234234
Emit_type(arrsConstraints, sErrCodeName) ::= <<
235-
ret = <arrsConstraints; separator=" and ">;
236-
ret = <sErrCodeName>;
237235
>>
238236

239237
call_superclass_func(p, sFuncName, soTypeCasting) ::= "ret = super().<sFuncName>() if hasattr(super(), '<sFuncName>') else Asn1ConstraintValidResult(is_valid=True)"

StgPython/test_cases_python.stg

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,6 @@ JoinItems(sPart, soNestedPart) ::= <<
8787
>>
8888

8989
Codec_declare_EncInDecOut_variable(sPrmName, sType, sPrmValue) ::= <<
90-
<sType> enc_<sPrmName> = <sPrmValue>;
91-
<sType> dec_<sPrmName>;
9290
>>
9391

9492
Codec_declare_DecIn_variable(sPrmName, sType) ::= "<sType> dec_<sPrmName>;"

0 commit comments

Comments
 (0)