Need help in writing up a Python Syntax checker

Discussion in 'Python' started by Kinokunya, Jul 14, 2008.

  1. Kinokunya

    Kinokunya Guest

    Hi guys,

    My group and I will be working on our final year project, the scope to
    do a program/web-based application similar areas of functionalities
    like the PyLint and PyChecker; a Python syntax checker. We have no
    Python background, equipped only with some knowledge of Java and Dot
    net.

    We did some research on PyLint and found out that there are 2 common
    modules that PyLint & PyChecker are using, namely logilab-astng and
    logilab-common. I'm not really sure what these 2 modules are for.



    Quoted from the offical site,

    The aim of this module (logilab-astng) is to provide a common base
    representation of python source code




    We're not really sure what they meant by common base representation of
    source codes. Does that mean logilab-astng is somewhat like a
    repository/library of Python syntax API so that we can easily 'call'
    these module to aid in syntax checking? My group and I were
    considering of using Java as a basis for this project, but if these 2
    modules were really the repositories for Python syntax codes then we
    are restricted to using Python to make full use of the above mentioned
    dependencies.

    Our current stand was to use Jython as it is able to support Java as
    well as the .PY files inside logilab-astng and logilab-common, but
    having no knowledge in Python, we're unable to make out whatever was
    in the 2 above modules, was was unable to find user support forums/
    communities for Logilab related stuff.

    You insights are greatly appreciated.


    Windows platform (XP & vista)
    Python (If need be, we will install the latest official version of it)
    Jython 2.2.1 (Latest version)
    Server: Apache Tomcat 2.2 (Should we require one for the project)
     
    Kinokunya, Jul 14, 2008
    #1
    1. Advertising

  2. Kinokunya

    Kay Schluehr Guest

    On 14 Jul., 08:22, Kinokunya <> wrote:
    > Hi guys,
    >
    > My group and I will be working on our final year project, the scope to
    > do a program/web-based application similar areas of functionalities
    > like the PyLint and PyChecker; a Python syntax checker. We have no
    > Python background, equipped only with some knowledge of Java and Dot
    > net.


    Python doesn't need a syntax checker. Syntax is checked by the parser
    and the parser is exposed to the user by means of the parser module.
    What you probably mean are *semantical* checks which are typical for
    compilers: e.g. whether names are used with prior assignments of
    values that cause runtime exceptions. These issues are in fact covered
    by PyLint and PyChecker.

    > We did some research on PyLint and found out that there are 2 common
    > modules that PyLint & PyChecker are using, namely logilab-astng and
    > logilab-common. I'm not really sure what these 2 modules are for.
    >
    > Quoted from the offical site,
    >
    > The aim of this module (logilab-astng) is to provide a common base
    > representation of python source code
    >
    > We're not really sure what they meant by common base representation of
    > source codes.


    Just switch to <MyPythonPath>\Scripts\ in your Vista installation

    and type `easy_install pylint`. This shall install PyLint in the
    directory

    <MyPythonPath>\lib\site-packages

    Additionally a pylint.bat file is placed in the <MyPythonPath>\Scripts
    \ directory.

    Type `pylint --help` and you get more information about the
    functionality of PyLint.
     
    Kay Schluehr, Jul 14, 2008
    #2
    1. Advertising

  3. Kinokunya

    Kinokunya Guest

    On Jul 14, 6:48 pm, Kay Schluehr <> wrote:
    > On 14 Jul., 08:22, Kinokunya <> wrote:
    >
    > > Hi guys,

    >
    > > My group and I will be working on our final year project, the scope to
    > > do a program/web-based application similar areas of functionalities
    > > like the PyLint and PyChecker; a Python syntax checker. We have no
    > > Python background, equipped only with some knowledge of Java and Dot
    > > net.

    >
    > Python doesn't need a syntax checker. Syntax is checked by the parser
    > and the parser is exposed to the user by means of the parser module.
    > What you probably mean are *semantical* checks which are typical for
    > compilers: e.g. whether names are used with prior assignments of
    > values that cause runtime exceptions. These issues are in fact covered
    > by PyLint and PyChecker.
    >
    > > We did some research on PyLint and found out that there are 2 common
    > > modules that PyLint & PyChecker are using, namely logilab-astng and
    > > logilab-common. I'm not really sure what these 2 modules are for.

    >
    > > Quoted from the offical site,

    >
    > > The aim of this module (logilab-astng) is to provide a common base
    > > representation of python source code

    >
    > > We're not really sure what they meant by common base representation of
    > > source codes.

    >
    > Just switch to <MyPythonPath>\Scripts\ in your Vista installation
    >
    > and type `easy_install pylint`. This shall install PyLint in the
    > directory
    >
    > <MyPythonPath>\lib\site-packages
    >
    > Additionally a pylint.bat file is placed in the <MyPythonPath>\Scripts
    > \ directory.
    >
    > Type `pylint --help` and you get more information about the
    > functionality of PyLint.






    Thanks for replying Kay Schluehr,

    The topic of our project was to do a program/software similar to
    PyLint and PyChecker, and the project scope does not require us to
    compile the codes. I guess by that it means 'semantic' checks in this
    case. Does that means we can make use of the parser module as
    mentioned above for semantic syntax checking?

    Our situation now is that we are torn between the programming
    languages to go, Java, Jython or Python, with no definite direction to
    start off our development. Any pointers would be appreciated.

    Thank you.
     
    Kinokunya, Jul 15, 2008
    #3
  4. Kinokunya

    Guest

    On Jul 14, 8:22 am, Kinokunya <> wrote:
    > Hi guys,
    >
    > My group and I will be working on our final year project, the scope to
    > do a program/web-based application similar areas of functionalities
    > like thePyLintand PyChecker; a Python syntax checker. We have no
    > Python background, equipped only with some knowledge of Java and Dot
    > net.


    Great, this means you'll get a change to learn a new great language.

    > We did some research on PyLint and found out that there are 2 common
    > modules thatPyLint & PyChecker are using, namely logilab-astng and
    > logilab-common. I'm not really sure what these 2 modules are for.


    To my best knowledge, pychecker does not use logilab-common or logilab-
    astng.

    > Quoted from the offical site,
    >
    >     The aim of this module (logilab-astng) is to provide a common base
    > representation of python source code
    >
    > We're not really sure what they meant by common base representation of
    > source codes. Does that mean logilab-astng is somewhat like a
    > repository/library of Python syntax API so that we can easily 'call'
    > these module to aid in syntax checking?


    logilab-astng is a python library which gives access to the Abstract
    Syntax
    Tree (AST) of some Python code. This representation is used by pylint
    to
    perform checks on the code without manipulating the source code
    directly.

    > Our current stand was to use Jython as it is able to support Java as
    > well as the .PY files inside logilab-astng and logilab-common, but
    > having no knowledge in Python, we're unable to make out whatever was
    > in the 2 above modules, was was unable to find user support forums/
    > communities for Logilab related stuff.


    Subscribe to the python-projects mailing list
    (http://lists.logilab.org/mailman/listinfo/python-projects)

    --
    Alexandre Fayolle
    Logilab
     
    , Jul 31, 2008
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. neerashish
    Replies:
    2
    Views:
    301
  2. horos11

    syntax checker in python

    horos11, Aug 7, 2009, in forum: Python
    Replies:
    4
    Views:
    2,206
  3. harry k
    Replies:
    8
    Views:
    1,027
    Awesomeguy9
    May 23, 2010
  4. Pager O Rama

    MSN BLOCK CHECKER-MSN STATUS CHECKER-MSN PROBLEMS

    Pager O Rama, Apr 4, 2006, in forum: ASP General
    Replies:
    0
    Views:
    296
    Pager O Rama
    Apr 4, 2006
  5. Jacob Grover
    Replies:
    5
    Views:
    351
    Jacob Grover
    Jul 18, 2008
Loading...

Share This Page