Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  exporter.py

  Sprache: Python
 

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

import json
import os
import sys

from ipdl.ast import ASYNC, SYNC
from ipdl.ast import IN, OUT, INOUT
from ipdl.ast import StringLiteral

from pprint import pprint

# We export some protocol data to JSON so it can be consumed and processed
# further by external tooling, such as Fuzzing/Security to automatically
# determine security boundaries and generate code coverage filters for
# certain protocols.


class JSONExporter:
    @staticmethod
    def protocolToObject(protocol):
        def implToString(impl):
            if impl is None:
                return None

            if type(impl) is StringLiteral:
                return str(impl.value)

            return str(impl)

        p = {
            "name": protocol.name,
            "namespaces": [x.name for x in protocol.namespaces],
            "managers": [x.name for x in protocol.managers],
            "parent_methods": [],
            "child_methods": [],
            "attributes": {
                x.name: implToString(x.value) for x in protocol.attributes.values()
            },
        }

        for md in protocol.messageDecls:

            def serialize_md(md):
                return {
                    "name": md.decl.progname,
                    "attributes": {x.name: x.value for x in md.attributes.values()},
                    "sync": md.sendSemantics == SYNC,
                    "params": [
                        {"type": x.ipdltype.name(), "name": x.name} for x in md.params
                    ],
                }

            if md.direction == IN or md.direction == INOUT:
                p["parent_methods"].append(serialize_md(md))

            if md.direction == OUT or md.direction == INOUT:
                p["child_methods"].append(serialize_md(md))

        return p

Messung V0.5 in Prozent
C=96 H=92 G=93

¤ Dauer der Verarbeitung: 0.14 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Open Source Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik

Statistik
#Sources=277311
#Domains=752002