Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000445Taste[All Projects] ASN.1 Compilerpublic2015-08-07 07:362018-05-14 07:18
Reportermaxime 
Assigned Togmamais 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusnewResolutionfixed 
PlatformOSOS Version
Summary0000445:

XmlAst.fs vs genericBackend.fs

Description

The F# code of the XML and generic backends are duplicate with 3 minor differences (see below).

The XML backend is used when using -ast option in the command line, while genericBackend is used when using -customStgBackend.

Some tools (DMT) use -customStgBackend xml.stg instead of -ast because it allows to combine with -customStgAstVersion and specify which AST level is needed.

The problem is that each modification in one of the backend has to be duplicated in the other one to avoid regression. This does not make the maintenance and testing very easy.

I propose to remove the XmlAst.fs backend and make the tool use genericBackend.fs when using the -ast option.

Side note:
The differences beteween the two backends, which need a minor update are the following:
1) in the call to VasXml (Value assignment) the parameter passed to the XML backend is generated from PrintAsn1.PrintAsn1Value while the generic backend used a specific PrintCustomAsn1Value (which is better and needs to be reflected in the xml.stg file)

2) the generic backend has an "AssigOp" template which does not exist in the xml template and would need to be added

3) the XML backend does not render the Contracts associated to the types (the last parameter of TaxXml is an empty string, while the genericBackend calls PrintContract).

These 3 differences are minor, since as said above the xml.stg backend can work with the genericBackend, so the only thing to do is to make sure that the PrintCustomAsn1Value in xml.stg use the same formating as the one in PrintAsn1.

TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0002428)
gmamais (developer)
2015-09-17 10:25

resolved in version 3.2.63

(0002430)
maxime (administrator)
2015-09-17 12:38

Thanks
I think there was another difference that I did not spot and that was removed but should be put back at some point in all users of genericBackend

let AllExported (m: Asn1Module) =
    match m.Exports with
    | All -> true
    | _ -> false    

I will do it, it implies modification of other STG backends (Python, VDM)


- Issue History
Date Modified Username Field Change
2015-08-07 07:36 maxime New Issue
2015-08-07 07:36 maxime Status

new => assigned

2015-08-07 07:36 maxime Assigned To

=> gmamais

2015-09-17 10:25 gmamais Note Added: 0002428
2015-09-17 10:25 gmamais Status

assigned => resolved

2015-09-17 10:25 gmamais Resolution

open => fixed

2015-09-17 12:38 maxime Note Added: 0002430
2018-05-14 07:18 maxime Status

resolved => new



Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker