Git Product home page Git Product logo

pyfranca's People

Contributors

zayfod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyfranca's Issues

fidl_diff.py tool for detecting interface changes

A command-line tool, based on franca_processor that takes two Franca models as input and outputs the differences between them.

A use case for such a tool would be detecting interface changes in automated build setups.

Franca IDL v0.11.1 support

  • unit tests needed to be implemented, based on the Franca IDL v0.11.1 user manual
  • appropriate support needs to be added for the changed features

Index error in p_struct_def_1

franca_parser.py line 604:
p[0] = ast.Struct(name=p[2], fields=p[4], flags=p[3])
fields=p[4] should be fields=p[5]

struct_def : STRUCT ID flag_defs '{' struct_fields '}'
p[1]: STRUCT
p[2]: ID
p[3]: glag_defs
p[4]: '{'
p[5]: struct_fields
p[6]: '}'

Parser do not detect doubled struct member

pyfranca.zip
Hello Zayfod

I have found pyfranca a few weeks ago and use it for a little code generator.
It works quit good. Thank you for your work.

Enclosed please find a zip file with some modifications on pyfranca.

I found 2 issues in you franca_parser.py.

  • The parser do not check for doubled members. I add the unittest test_doubled_member() to show the problem.
    struct MyStruct
    {
    UInt32 value
    UInt16 value
    }

  • The parser also have a problem with types like ., e.g.

method myMethod {
in {
MyType.MyStruct data
}
}
I add the unittest test_alternative_import() to show the problem.

Currently pyfranca "only" generates the ast from the fidl file. I am looking for a way to validate the fidl files. Checking for undefined types, broken imports etc. I add franca_validator.py. You can add several fidl packages to class Validator and then validate the parsed packages. The corresponding unittests show you how to use it. franca_validator.py is far away from being finished. But it should give you an impression, what I mean.

best regards
Jens

Complex constant support

There is support for primitive type constants/literals (e.g. integers, floats, strings, etc.) as introduced by @jb090979.

This can be used as a base for introducing complex type constants (e.g. arrays, structures, maps, etc.).

New error handling system

Currently pyfranca's error handling is rudimentary. Whenever lexer, parser, or processor errors are detected an exception is raised and further processing stops.

Error handling has to be reworked to allow keeping a list of detected errors (objects) as part of a processor. Processing should stop only when fatal errors are detected. Simpler lexer and parser errors should just be detected and added to the list but processing should continue.

franca_doc.py documentation generation tool

A new module and command-line tool that take a Franca IDL model as input and generate documentation in some form, based on the AST and structured comments.

Potential output format options are:

  • Sphinx - appropriate for Python environments
    • the AST can be converted to reStructuredText, similar to a Breathe renderer
    • a docutils node tree can be generated directly from the AST
  • Doxygen through OMG-IDL, similar to this implementation - franca/franca#141
  • other suggestions?

looking for a class to validate franca packages

Currently pyfranca "only" generates the ast from the fidl file. I am looking for a way to validate the fidl files. Checking for undefined types, broken imports etc. I add franca_validator.py. You can add several fidl packages to class Validator and then validate the parsed packages. The corresponding unittests show you how to use it. franca_validator.py is far away from being finished. But it should give you an impression, what I mean.

Enclosed please find a zip file with some modifications on pyfranca.
pyfranca.zip

same package name in multiple fidl files

I check the latest Version 0.2.1 and run into some trouble with the processor. The process checks that the package.name is not defined in multiple files. But as I understand Franca IDL this is a valid syntax. The package.name is the scope of the interfaces and typecollections and I can split a scope over multiple files.

Attached please find 2 fidl files. Your validator told me a circular dependency. But the official CommonAPI Generator accept these fidls files.

fidl_validator.py -I packages Hello.fidl definitions.fidl
ERROR: Circular dependency for package 'myPackage'.

As I understand franca_processor.py the problem is that you use the package.name as the key name of an package. If you take a look into my franca_validator.py I use the fidl file name as the key name. I am not sure that the fild file in the import instruction is just the file name or is it a path. I assume it is a path. The franca user guide does not sepcify the import instruction completely.
import myPackage.MyTypes.* from "definitions.fidl"

franca_processor.py Line 339
self.packages[package.name] = package

franca_validator.py Line 34
abs_path = os.path.abspath(fspec)
self.packages[abs_path] = fpackage

best regards
jens

fidl.tar.gz

CommonAPI DBus mock object generator

The idea is to create a new module and corresponding command-line tool that can take a Franca IDL model and generate CommonAPI DBus mock objects, e.g. based on pythond-dbus that can later be used in automated tests, based on Python's unittest methodology.

This is a stretch goal, currently out of the scope of pyfranca. If there is interest hough, help is always welcome! :)

AST serializer

A mdule that can take a Franca IDL AST representation and output it as Franca IDL to a StringIO buffer.

The AST serializer sould work similar to Python's json.dump() and json.dumps().

Among other things, this will allow more unit-testing.

Bug in Fidl Import

The current Version 0.3.0 of pyfranca cannot import a chain of fidl file.
If A.fidl import B.fild, wich imports C.fidl causes the error that all Symbols in C.fidl are missing, because C.fidl isn't processed.

I check the pyfranca code and may found the root cause. I create a pull request with an unittest that show the problem. See pull request 11 for further details.
#11

unable to extract/associate single line and block comment in fidl parser

Hi all

I am not able to associate block comment and single line comment with the structure or any other type
only structured comment is getting associated, please let me know how to fix this issue,

package Common
<** @description : struct S
@author Jens Baumann
**>

typeCollection X
{
// Manish - this is not getting associated
struct Common_message
{
// @brief If Skew is larger than
/*
comment 1 - this is not getting associated
*/
Boolean COM_Last_Clock_Sync_Error
}
}

Thank you
Manish

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.