Skip to content

Commit e0d88da

Browse files
committed
1 parent 00326a7 commit e0d88da

File tree

3 files changed

+30
-2
lines changed

3 files changed

+30
-2
lines changed

CommonTypes/AcnGenericTypes.fs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ type GenericAcnProperty =
480480
| MAPPING_FUNCTION of (StringLoc option)*StringLoc
481481
| POST_ENCODING_FUNCTION of (StringLoc option)*StringLoc
482482
| PRE_DECODING_FUNCTION of (StringLoc option)*StringLoc
483+
483484

484485

485486

FrontEndAst/AcnCreateFromAntlr.fs

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,9 +578,36 @@ let private mergeBitStringType (asn1:Asn1Ast.AstRoot)
578578

579579
let private mergeNullType (args: CommandLineSettings) (lms:(ProgrammingLanguage*LanguageMacros) list) (acnErrLoc: SrcLoc option) (props: GenericAcnProperty list) (tdarg: GetTypeDefinition_arg) (us: Asn1AcnMergeState) =
580580
let getRtlTypeName (l:ProgrammingLanguage) = (args.getBasicLang l).getNullRtlTypeName
581+
582+
//check for invalid properties
583+
let checkInvalidProperties (acnErrLoc: SrcLoc) (props: GenericAcnProperty list) =
584+
props |> Seq.iter(fun pr ->
585+
match pr with
586+
| SIZE _ -> raise(SemanticError(acnErrLoc, "Acn property 'size' cannot be applied to NULL types"))
587+
| ENCODING _ -> raise(SemanticError(acnErrLoc, "Acn property 'encoding' cannot be applied to NULL types"))
588+
| ALIGNTONEXT _ -> ()
589+
| ENCODE_VALUES -> raise(SemanticError(acnErrLoc, "Acn property 'encode-values' cannot be applied to NULL types"))
590+
| SAVE_POSITION -> ()
591+
| PRESENT_WHEN _ -> ()
592+
| PRESENT_WHEN_EXP _ -> ()
593+
| TRUE_VALUE _ -> raise(SemanticError(acnErrLoc, "Acn property 'true-value' cannot be applied to NULL types"))
594+
| FALSE_VALUE _ -> raise(SemanticError(acnErrLoc, "Acn property 'false-value' cannot be applied to NULL types"))
595+
| PATTERN _ -> ()
596+
| CHOICE_DETERMINANT _ -> raise(SemanticError(acnErrLoc, "Acn property 'choice-determinant' cannot be applied to NULL types"))
597+
| ENDIANNESS _ -> raise(SemanticError(acnErrLoc, "Acn property 'endianness' cannot be applied to NULL types"))
598+
| ENUM_SET_VALUE _ -> raise(SemanticError(acnErrLoc, "Acn property 'enum-set-value' cannot be applied to NULL types"))
599+
| TERMINATION_PATTERN _ -> raise(SemanticError(acnErrLoc, "Acn property 'termination-pattern' cannot be applied to NULL types"))
600+
| MAPPING_FUNCTION _ -> ()
601+
| POST_ENCODING_FUNCTION _ -> ()
602+
| PRE_DECODING_FUNCTION _ -> ())
603+
604+
605+
581606
let acnProperties =
582607
match acnErrLoc with
583-
| Some acnErrLoc -> { NullTypeAcnProperties.encodingPattern = tryGetProp props (fun x -> match x with PATTERN e -> Some e | _ -> None); savePosition = props |> Seq.exists(fun z -> match z with SAVE_POSITION -> true | _ -> false )}
608+
| Some acnErrLoc ->
609+
checkInvalidProperties acnErrLoc props
610+
{ NullTypeAcnProperties.encodingPattern = tryGetProp props (fun x -> match x with PATTERN e -> Some e | _ -> None); savePosition = props |> Seq.exists(fun z -> match z with SAVE_POSITION -> true | _ -> false )}
584611
| None -> {NullTypeAcnProperties.encodingPattern = None; savePosition = false }
585612

586613
let alignment = tryGetProp props (fun x -> match x with ALIGNTONEXT e -> Some e | _ -> None)

asn1scc/Program.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ let printVersion () =
124124
//let fvi = System.Diagnostics.FileVersionInfo.GetVersionInfo(assembly.Location);
125125
//let version = fvi.FileVersion;
126126

127-
let version = "4.6.0.5"
127+
let version = "4.6.0.6"
128128
printfn "asn1scc version %s\n" version
129129
()
130130

0 commit comments

Comments
 (0)