python imports
Andrey Torba <[email protected]>
| Newsgroups | gmane.emacs.cedet |
|---|---|
| Message-ID | <CAFMdeWDnscAFwFvDJUKzK5KZwnH16Y5cx6ynwOG5cGrvML8roA@mail.gmail.com> |
Hello CEDET developers,
I'm investigating how to parse python's imports for the cases:
1. from ... import <classes> (works well in current implementation)
Example:
from a.b.c import Class1, Class2
2. from ... import <modules> (doesn't work)
Example:
from a.b.c import module1, module2
In this case parser must create:
- two INCLUDE-TAGs: 'a.b.c.module1' and 'a.b.c.module2'.
When we import something we don't know if it is module or class or
function... So include-tag should be 'a.b.c.something', 'a.b.c.class1',
'a.b.c.module1'. And then in the functions
'semantic-dependency-find-file-on-path' and 'semantic-tag-include-filename'
we can guess which file to open:
- a/b/c/something.py
- a/b/c.py class:something
- a/b/c/__init__.py class:something
My question is: how can i build the grammar which makes 2 include tags from
the string: 'from a.b.c import module1, module2'. I need to remember
context ('a.b.c') and then build a full module path (format "%s.%s" "a.b.c"
"module1") ?
Thanks,
-Andrey
------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Cedet-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cedet-devel