# HG changeset patch # User jeandet # Date 2014-04-15 23:00:15 # Node ID bd5e6825bd26cce7e5d73261c979638a8d8e49e4 # Parent 0000000000000000000000000000000000000000 First Init, kicad lisp-like files abstract parser done. diff --git a/.hgignore b/.hgignore new file mode 100644 --- /dev/null +++ b/.hgignore @@ -0,0 +1,3 @@ +syntax: glob +*.pro.user +*~ diff --git a/COPYING b/COPYING new file mode 100644 --- /dev/null +++ b/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. diff --git a/README.md b/README.md new file mode 100644 --- /dev/null +++ b/README.md @@ -0,0 +1,39 @@ +Kicad Tools +----------- + +Kicad Tools is a set of tolls which aims to extend kicad functionality. + +Licensing +--------- + +Kicad Tools is provided under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2 of the License, or (at your option) any +later version. + +Wiki +---- + +More details [here](https://hephaistos.lpp.polytechnique.fr/redmine/projects/kicadtools/wiki) + +How to build +------------ + +To build it on linux you can look here https://hephaistos.lpp.polytechnique.fr/redmine/projects/kicadtools/wiki/Linux_setup + +If you can't access to it, first you will need a working qt5 kit with all the development packages. + Step 1: + Get and install SocExplorer +```Bash + hg clone https://hephaistos.lpp.polytechnique.fr/rhodecode/HG_REPOSITORIES/LPP/INSTRUMENTATION/kicadtools kicadtools + cd kicadtools + qmake-qt5 + make + sudo make install +``` + + +Bug repports +------------ + +To repport any bug you can either send a [mail](mailto:alexis.jeandet@member.fsf.org) or repport an issue [here](https://hephaistos.lpp.polytechnique.fr/redmine/projects/kicadtools/issues) + diff --git a/kicadTools.pro b/kicadTools.pro new file mode 100644 --- /dev/null +++ b/kicadTools.pro @@ -0,0 +1,24 @@ +#================================================================================================ +# +# _| _| _| _| _|_|_|_|_| _| +# _| _| _|_|_| _|_|_| _|_|_| _| _|_| _|_| _| _|_|_ +# _|_| _| _| _| _| _| _| _| _| _| _| _| _| _|_| +# _| _| _| _| _| _| _| _| _| _| _| _| _| _| _|_ +# _| _| _| _|_|_| _|_|_| _|_|_| _| _|_| _|_| _| _|_|_| +# +#================================================================================================ +# +# + + +TEMPLATE = subdirs +CONFIG += ordered release + +SUBDIRS += qilib \ + test + + + +OTHER_FILES += \ + README.md \ + COPYING diff --git a/qilib/Makefile b/qilib/Makefile new file mode 100644 --- /dev/null +++ b/qilib/Makefile @@ -0,0 +1,560 @@ +############################################################################# +# Makefile for building: libQIlib.so.1.0.0 +# Generated by qmake (3.0) (Qt 5.2.1) +# Project: QIlib.pro +# Template: lib +# Command: /usr/bin/qmake-qt5 -o Makefile QIlib.pro +############################################################################# + +MAKEFILE = Makefile + +####### Compiler, tools and options + +CC = gcc +CXX = g++ +DEFINES = -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB +CFLAGS = -m64 -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES) +CXXFLAGS = -m64 -pipe -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -O2 -Wall -W -D_REENTRANT -fPIC $(DEFINES) +INCPATH = -I/usr/lib64/qt5/mkspecs/linux-g++-64 -I. -Iparsers -I/usr/include/qt5 -I/usr/include/qt5/QtWidgets -I/usr/include/qt5/QtGui -I/usr/include/qt5/QtCore -Imoc +LINK = g++ +LFLAGS = -m64 -Wl,-O1 -Wl,-z,relro -shared -Wl,-soname,libQIlib.so.1 +LIBS = $(SUBLIBS) -L/usr/X11R6/lib64 -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread +AR = ar cqs +RANLIB = +QMAKE = /usr/bin/qmake-qt5 +TAR = tar -cf +COMPRESS = gzip -9f +COPY = cp -f +SED = sed +COPY_FILE = cp -f +COPY_DIR = cp -f -R +STRIP = +INSTALL_FILE = install -m 644 -p +INSTALL_DIR = $(COPY_DIR) +INSTALL_PROGRAM = install -m 755 -p +DEL_FILE = rm -f +SYMLINK = ln -f -s +DEL_DIR = rmdir +MOVE = mv -f +CHK_DIR_EXISTS= test -d +MKDIR = mkdir -p + +####### Output directory + +OBJECTS_DIR = obj/ + +####### Files + +SOURCES = qicadnetlist.cpp \ + qicadnet.cpp \ + qicadnetlistparser.cpp \ + parsers/lispLike_driver.cpp \ + parsers/lispLike_scanner.cpp lispLike.scanner.cpp \ + lispLike.parser.cpp +OBJECTS = obj/qicadnetlist.o \ + obj/qicadnet.o \ + obj/qicadnetlistparser.o \ + obj/lispLike_driver.o \ + obj/lispLike_scanner.o \ + obj/lispLike.scanner.o \ + obj/lispLike.parser.o +DIST = /usr/lib64/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib64/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib64/qt5/mkspecs/common/unix.conf \ + /usr/lib64/qt5/mkspecs/common/linux.conf \ + /usr/lib64/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib64/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib64/qt5/mkspecs/common/g++-base.conf \ + /usr/lib64/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib64/qt5/mkspecs/qconfig.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_clucene_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_compositor.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_compositor_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_declarative.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_declarative_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_designer.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_designer_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_designercomponents_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_help.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_help_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qml.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qml_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qmldevtools_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_quick.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_quick_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_quickparticles_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_script.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_script_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_svg_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_uitools.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_uitools_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_webkit.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_webkit_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns_private.pri \ + /usr/lib64/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib64/qt5/mkspecs/features/qt_config.prf \ + /usr/lib64/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib64/qt5/mkspecs/features/spec_post.prf \ + /usr/lib64/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib64/qt5/mkspecs/features/default_pre.prf \ + parsers/Flex_Bison_FIles/Flex_Bison_FIles.pri \ + /usr/lib64/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib64/qt5/mkspecs/features/default_post.prf \ + /usr/lib64/qt5/mkspecs/features/unix/gdb_dwarf_index.prf \ + /usr/lib64/qt5/mkspecs/features/warn_on.prf \ + /usr/lib64/qt5/mkspecs/features/qt.prf \ + /usr/lib64/qt5/mkspecs/features/resources.prf \ + /usr/lib64/qt5/mkspecs/features/moc.prf \ + /usr/lib64/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib64/qt5/mkspecs/features/uic.prf \ + /usr/lib64/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib64/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib64/qt5/mkspecs/features/exceptions.prf \ + /usr/lib64/qt5/mkspecs/features/yacc.prf \ + /usr/lib64/qt5/mkspecs/features/lex.prf \ + QIlib.pro \ + QIlib.pro +QMAKE_TARGET = QIlib +DESTDIR = #avoid trailing-slash linebreak +TARGET = libQIlib.so.1.0.0 +TARGETA = libQIlib.a +TARGETD = libQIlib.so.1.0.0 +TARGET0 = libQIlib.so +TARGET1 = libQIlib.so.1 +TARGET2 = libQIlib.so.1.0 + + +first: all +####### Implicit rules + +.SUFFIXES: .o .c .cpp .cc .cxx .C + +.cpp.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cc.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.cxx.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.C.o: + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o "$@" "$<" + +.c.o: + $(CC) -c $(CFLAGS) $(INCPATH) -o "$@" "$<" + +####### Build rules + +all: Makefile $(TARGET) + +$(TARGET): lispLike.parser.cpp $(OBJECTS) $(SUBLIBS) $(OBJCOMP) + -$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) + $(LINK) $(LFLAGS) -o $(TARGET) $(OBJECTS) $(LIBS) $(OBJCOMP) + -ln -s $(TARGET) $(TARGET0) + -ln -s $(TARGET) $(TARGET1) + -ln -s $(TARGET) $(TARGET2) + + + +staticlib: $(TARGETA) + +$(TARGETA): lispLike.parser.cpp $(OBJECTS) $(OBJCOMP) + -$(DEL_FILE) $(TARGETA) + $(AR) $(TARGETA) $(OBJECTS) + +Makefile: QIlib.pro /usr/lib64/qt5/mkspecs/linux-g++-64/qmake.conf /usr/lib64/qt5/mkspecs/features/spec_pre.prf \ + /usr/lib64/qt5/mkspecs/common/shell-unix.conf \ + /usr/lib64/qt5/mkspecs/common/unix.conf \ + /usr/lib64/qt5/mkspecs/common/linux.conf \ + /usr/lib64/qt5/mkspecs/common/gcc-base.conf \ + /usr/lib64/qt5/mkspecs/common/gcc-base-unix.conf \ + /usr/lib64/qt5/mkspecs/common/g++-base.conf \ + /usr/lib64/qt5/mkspecs/common/g++-unix.conf \ + /usr/lib64/qt5/mkspecs/qconfig.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_clucene_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_compositor.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_compositor_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_core.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_core_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_dbus.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_dbus_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_declarative.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_declarative_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_designer.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_designer_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_designercomponents_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_gui.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_gui_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_help.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_help_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_network.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_network_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_opengl.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_opengl_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qml.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qml_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qmldevtools_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_quick.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_quick_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_quickparticles_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_script.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_script_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_sql.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_sql_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_svg.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_svg_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_testlib.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_testlib_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_uitools.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_uitools_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_webkit.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_webkit_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_widgets.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_widgets_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_xml.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_xml_private.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri \ + /usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns_private.pri \ + /usr/lib64/qt5/mkspecs/features/qt_functions.prf \ + /usr/lib64/qt5/mkspecs/features/qt_config.prf \ + /usr/lib64/qt5/mkspecs/linux-g++-64/qmake.conf \ + /usr/lib64/qt5/mkspecs/features/spec_post.prf \ + /usr/lib64/qt5/mkspecs/features/exclusive_builds.prf \ + /usr/lib64/qt5/mkspecs/features/default_pre.prf \ + parsers/Flex_Bison_FIles/Flex_Bison_FIles.pri \ + /usr/lib64/qt5/mkspecs/features/resolve_config.prf \ + /usr/lib64/qt5/mkspecs/features/default_post.prf \ + /usr/lib64/qt5/mkspecs/features/unix/gdb_dwarf_index.prf \ + /usr/lib64/qt5/mkspecs/features/warn_on.prf \ + /usr/lib64/qt5/mkspecs/features/qt.prf \ + /usr/lib64/qt5/mkspecs/features/resources.prf \ + /usr/lib64/qt5/mkspecs/features/moc.prf \ + /usr/lib64/qt5/mkspecs/features/unix/opengl.prf \ + /usr/lib64/qt5/mkspecs/features/uic.prf \ + /usr/lib64/qt5/mkspecs/features/unix/thread.prf \ + /usr/lib64/qt5/mkspecs/features/testcase_targets.prf \ + /usr/lib64/qt5/mkspecs/features/exceptions.prf \ + /usr/lib64/qt5/mkspecs/features/yacc.prf \ + /usr/lib64/qt5/mkspecs/features/lex.prf \ + QIlib.pro \ + /lib64/libQt5Widgets.prl \ + /lib64/libQt5Gui.prl \ + /lib64/libQt5Core.prl + $(QMAKE) -o Makefile QIlib.pro +/usr/lib64/qt5/mkspecs/features/spec_pre.prf: +/usr/lib64/qt5/mkspecs/common/shell-unix.conf: +/usr/lib64/qt5/mkspecs/common/unix.conf: +/usr/lib64/qt5/mkspecs/common/linux.conf: +/usr/lib64/qt5/mkspecs/common/gcc-base.conf: +/usr/lib64/qt5/mkspecs/common/gcc-base-unix.conf: +/usr/lib64/qt5/mkspecs/common/g++-base.conf: +/usr/lib64/qt5/mkspecs/common/g++-unix.conf: +/usr/lib64/qt5/mkspecs/qconfig.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_bootstrap_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_clucene_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_compositor.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_compositor_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_concurrent_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_core.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_core_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_dbus_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_declarative.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_declarative_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_designer.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_designer_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_designercomponents_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_gui.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_gui_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_help.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_help_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_multimedia_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_multimediawidgets_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_network.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_network_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_opengl_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_openglextensions_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_platformsupport_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_printsupport_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_qml.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_qml_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_qmldevtools_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_qmltest_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_qtmultimediaquicktools_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_quick.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_quick_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_quickparticles_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_script.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_script_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_scripttools_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_sql.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_sql_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_svg.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_svg_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_testlib_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_uitools_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_webkit.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_webkit_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_webkitwidgets_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_widgets_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_x11extras_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_xml.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_xml_private.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns.pri: +/usr/lib64/qt5/mkspecs/modules/qt_lib_xmlpatterns_private.pri: +/usr/lib64/qt5/mkspecs/features/qt_functions.prf: +/usr/lib64/qt5/mkspecs/features/qt_config.prf: +/usr/lib64/qt5/mkspecs/linux-g++-64/qmake.conf: +/usr/lib64/qt5/mkspecs/features/spec_post.prf: +/usr/lib64/qt5/mkspecs/features/exclusive_builds.prf: +/usr/lib64/qt5/mkspecs/features/default_pre.prf: +parsers/Flex_Bison_FIles/Flex_Bison_FIles.pri: +/usr/lib64/qt5/mkspecs/features/resolve_config.prf: +/usr/lib64/qt5/mkspecs/features/default_post.prf: +/usr/lib64/qt5/mkspecs/features/unix/gdb_dwarf_index.prf: +/usr/lib64/qt5/mkspecs/features/warn_on.prf: +/usr/lib64/qt5/mkspecs/features/qt.prf: +/usr/lib64/qt5/mkspecs/features/resources.prf: +/usr/lib64/qt5/mkspecs/features/moc.prf: +/usr/lib64/qt5/mkspecs/features/unix/opengl.prf: +/usr/lib64/qt5/mkspecs/features/uic.prf: +/usr/lib64/qt5/mkspecs/features/unix/thread.prf: +/usr/lib64/qt5/mkspecs/features/testcase_targets.prf: +/usr/lib64/qt5/mkspecs/features/exceptions.prf: +/usr/lib64/qt5/mkspecs/features/yacc.prf: +/usr/lib64/qt5/mkspecs/features/lex.prf: +QIlib.pro: +/lib64/libQt5Widgets.prl: +/lib64/libQt5Gui.prl: +/lib64/libQt5Core.prl: +qmake: FORCE + @$(QMAKE) -o Makefile QIlib.pro + +qmake_all: FORCE + +dist: + @test -d obj/QIlib1.0.0 || mkdir -p obj/QIlib1.0.0 + $(COPY_FILE) --parents $(SOURCES) $(DIST) obj/QIlib1.0.0/ && $(COPY_FILE) --parents parsers/Flex_Bison_FIles/lispLike.scanner.l obj/QIlib1.0.0/ && $(COPY_FILE) --parents parsers/Flex_Bison_FIles/lispLike.parser.yy obj/QIlib1.0.0/ && $(COPY_FILE) --parents qicadnetlist.h qicadnet.h qicadnetlistparser.h parsers/lispLike_driver.h parsers/lispLike_scanner.h obj/QIlib1.0.0/ && $(COPY_FILE) --parents qicadnetlist.cpp qicadnet.cpp qicadnetlistparser.cpp parsers/lispLike_driver.cpp parsers/lispLike_scanner.cpp obj/QIlib1.0.0/ && (cd `dirname obj/QIlib1.0.0` && $(TAR) QIlib1.0.0.tar QIlib1.0.0 && $(COMPRESS) QIlib1.0.0.tar) && $(MOVE) `dirname obj/QIlib1.0.0`/QIlib1.0.0.tar.gz . && $(DEL_FILE) -r obj/QIlib1.0.0 + + +clean:compiler_clean + -$(DEL_FILE) $(OBJECTS) + -$(DEL_FILE) *~ core *.core + + +####### Sub-libraries + +distclean: clean + -$(DEL_FILE) $(TARGET) + -$(DEL_FILE) $(TARGET0) $(TARGET1) $(TARGET2) $(TARGETA) + -$(DEL_FILE) Makefile + + +mocclean: compiler_moc_header_clean compiler_moc_source_clean + +mocables: compiler_moc_header_make_all compiler_moc_source_make_all + +check: first + +compiler_flex_make_all: lispLike.scanner.cpp +compiler_flex_clean: + -$(DEL_FILE) lispLike.scanner.cpp +lispLike.scanner.cpp: parsers/Flex_Bison_FIles/lispLike.scanner.l + flex -i -olispLike.scanner.cpp parsers/Flex_Bison_FIles/lispLike.scanner.l + +compiler_bison_make_all: lispLike.parser.cpp +compiler_bison_clean: + -$(DEL_FILE) lispLike.parser.cpp +lispLike.parser.cpp: parsers/Flex_Bison_FIles/lispLike.parser.yy + bison -d -o lispLike.parser.cpp parsers/Flex_Bison_FIles/lispLike.parser.yy + +compiler_rcc_make_all: +compiler_rcc_clean: +compiler_moc_header_make_all: +compiler_moc_header_clean: +compiler_moc_source_make_all: +compiler_moc_source_clean: +compiler_uic_make_all: +compiler_uic_clean: +compiler_yacc_decl_make_all: +compiler_yacc_decl_clean: +compiler_yacc_impl_make_all: +compiler_yacc_impl_clean: +compiler_lex_make_all: +compiler_lex_clean: +compiler_clean: compiler_flex_clean compiler_bison_clean + +####### Compile + +obj/qicadnetlist.o: qicadnetlist.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/qicadnetlist.o qicadnetlist.cpp + +obj/qicadnet.o: qicadnet.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/qicadnet.o qicadnet.cpp + +obj/qicadnetlistparser.o: qicadnetlistparser.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/qicadnetlistparser.o qicadnetlistparser.cpp + +obj/lispLike_driver.o: parsers/lispLike_driver.cpp parsers/lispLike_driver.h \ + parsers/lispLike_scanner.h \ + /usr/include/qt5/QtCore/QString \ + /usr/include/qt5/QtCore/qstring.h \ + /usr/include/qt5/QtCore/qchar.h \ + /usr/include/qt5/QtCore/qglobal.h \ + /usr/include/qt5/QtCore/qconfig.h \ + /usr/include/qt5/QtCore/qconfig-64.h \ + /usr/include/qt5/QtCore/qfeatures.h \ + /usr/include/qt5/QtCore/qsystemdetection.h \ + /usr/include/qt5/QtCore/qprocessordetection.h \ + /usr/include/qt5/QtCore/qcompilerdetection.h \ + /usr/include/qt5/QtCore/qglobalstatic.h \ + /usr/include/qt5/QtCore/qatomic.h \ + /usr/include/qt5/QtCore/qbasicatomic.h \ + /usr/include/qt5/QtCore/qatomic_bootstrap.h \ + /usr/include/qt5/QtCore/qgenericatomic.h \ + /usr/include/qt5/QtCore/qatomic_msvc.h \ + /usr/include/qt5/QtCore/qatomic_integrity.h \ + /usr/include/qt5/QtCore/qoldbasicatomic.h \ + /usr/include/qt5/QtCore/qatomic_vxworks.h \ + /usr/include/qt5/QtCore/qatomic_power.h \ + /usr/include/qt5/QtCore/qatomic_alpha.h \ + /usr/include/qt5/QtCore/qatomic_armv7.h \ + /usr/include/qt5/QtCore/qatomic_armv6.h \ + /usr/include/qt5/QtCore/qatomic_armv5.h \ + /usr/include/qt5/QtCore/qatomic_bfin.h \ + /usr/include/qt5/QtCore/qatomic_ia64.h \ + /usr/include/qt5/QtCore/qatomic_mips.h \ + /usr/include/qt5/QtCore/qatomic_s390.h \ + /usr/include/qt5/QtCore/qatomic_sh4a.h \ + /usr/include/qt5/QtCore/qatomic_sparc.h \ + /usr/include/qt5/QtCore/qatomic_x86.h \ + /usr/include/qt5/QtCore/qatomic_cxx11.h \ + /usr/include/qt5/QtCore/qatomic_gcc.h \ + /usr/include/qt5/QtCore/qatomic_unix.h \ + /usr/include/qt5/QtCore/qmutex.h \ + /usr/include/qt5/QtCore/qlogging.h \ + /usr/include/qt5/QtCore/qflags.h \ + /usr/include/qt5/QtCore/qtypeinfo.h \ + /usr/include/qt5/QtCore/qtypetraits.h \ + /usr/include/qt5/QtCore/qsysinfo.h \ + /usr/include/qt5/QtCore/qbytearray.h \ + /usr/include/qt5/QtCore/qrefcount.h \ + /usr/include/qt5/QtCore/qnamespace.h \ + /usr/include/qt5/QtCore/qarraydata.h \ + /usr/include/qt5/QtCore/qstringbuilder.h \ + /usr/include/qt5/QtCore/QList \ + /usr/include/qt5/QtCore/qlist.h \ + /usr/include/qt5/QtCore/qalgorithms.h \ + /usr/include/qt5/QtCore/qiterator.h \ + /usr/include/qt5/QtCore/QStringList \ + /usr/include/qt5/QtCore/qstringlist.h \ + /usr/include/qt5/QtCore/qdatastream.h \ + /usr/include/qt5/QtCore/qscopedpointer.h \ + /usr/include/qt5/QtCore/qiodevice.h \ + /usr/include/qt5/QtCore/qobject.h \ + /usr/include/qt5/QtCore/qobjectdefs.h \ + /usr/include/qt5/QtCore/qobjectdefs_impl.h \ + /usr/include/qt5/QtCore/qcoreevent.h \ + /usr/include/qt5/QtCore/qmetatype.h \ + /usr/include/qt5/QtCore/qvarlengtharray.h \ + /usr/include/qt5/QtCore/qcontainerfwd.h \ + /usr/include/qt5/QtCore/qisenum.h \ + /usr/include/qt5/QtCore/qobject_impl.h \ + /usr/include/qt5/QtCore/qpair.h \ + /usr/include/qt5/QtCore/qregexp.h \ + /usr/include/qt5/QtCore/qstringmatcher.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lispLike_driver.o parsers/lispLike_driver.cpp + +obj/lispLike_scanner.o: parsers/lispLike_scanner.cpp parsers/lispLike_scanner.h + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lispLike_scanner.o parsers/lispLike_scanner.cpp + +obj/lispLike.scanner.o: lispLike.scanner.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lispLike.scanner.o lispLike.scanner.cpp + +obj/lispLike.parser.o: lispLike.parser.cpp + $(CXX) -c $(CXXFLAGS) $(INCPATH) -o obj/lispLike.parser.o lispLike.parser.cpp + +####### Install + +install: FORCE + +uninstall: FORCE + +FORCE: + diff --git a/qilib/parsers/Flex_Bison_FIles/Flex_Bison_FIles.pri b/qilib/parsers/Flex_Bison_FIles/Flex_Bison_FIles.pri new file mode 100644 --- /dev/null +++ b/qilib/parsers/Flex_Bison_FIles/Flex_Bison_FIles.pri @@ -0,0 +1,64 @@ +#================================================== +# +# _|_| _|_|_| _| _| _| +# _| _| _| _| _|_|_| +# _| _|_| _| _| _| _| _| +# _| _| _| _| _| _| _| +# _|_| _| _|_|_| _| _| _|_|_| +# +#================================================== +# +# + +message(" Check if Flex is installed ") +!system( "flex -V > temp" ){ + error("flex isn't installed, you should install it first or check that it is in the PATH") + system( $$QMAKE_DEL_FILE $$PWD"/temp" ) +} +message(" Success Flex is installed ") +message(" Check if Bison is installed ") +!system( "bison -V > temp" ){ + error("bison isn't installed, you should install it first or check that it is in the PATH") + system( $$QMAKE_DEL_FILE $$PWD"/temp" ) +} +message(" Success Bison is installed ") +system( $$QMAKE_DEL_FILE $$PWD"/temp" ) + +FLEXSOURCES += \ + $${PWD}/lispLike.l + +BISONSOURCES += \ + $${PWD}/lispLike.yy + +lispLikeHeaders.path = $$[QT_INSTALL_HEADERS]/QIlib/lispLike +lispLikeHeaders.files = \ + $${DESTDIR}/../lispLike/lispLike.hpp \ + $${DESTDIR}/../lispLike/location.hh \ + $${DESTDIR}/../lispLike/position.hh \ + $${DESTDIR}/../lispLike/stack.hh + +INCLUDEPATH += $${DESTDIR}/.. +INSTALLS += lispLikeHeaders + +flex.name = Flex +flex.input = FLEXSOURCES +flex.output = ${QMAKE_FILE_BASE}"/lex."${QMAKE_FILE_BASE}.cpp +flex.commands = flex -i -o${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} +flex.variable_out = SOURCES +QMAKE_EXTRA_COMPILERS += flex + +bison.name = Bison +bison.input = BISONSOURCES +bison.output = ${QMAKE_FILE_BASE}"/"${QMAKE_FILE_BASE}.cpp +bison.commands = bison -d -o ${QMAKE_FILE_OUT} ${QMAKE_FILE_IN} +bison.CONFIG += target_predeps +bison.variable_out = SOURCES +QMAKE_EXTRA_COMPILERS += bison + +OTHER_FILES += \ + $$BISONSOURCES \ + $$FLEXSOURCES + + + + diff --git a/qilib/parsers/Flex_Bison_FIles/lispLike.l b/qilib/parsers/Flex_Bison_FIles/lispLike.l new file mode 100644 --- /dev/null +++ b/qilib/parsers/Flex_Bison_FIles/lispLike.l @@ -0,0 +1,75 @@ +%{ +/* C++ string header, for string ops below */ +#include +#include +/* Implementation of yyFlexScanner */ +#include "lispLike_scanner.h" +#include "lispLike.hpp" + +/* typedef to make the returns for the tokens shorter */ +typedef QIlib::lispLike_Parser::token token; + +/* define to keep from re-typing the same code over and over */ +#define STOKEN( x ) ( new QString( x ) ) + +/* define yyterminate as this instead of NULL */ +//#define yyterminate() return( token::END ) + +/* msvc2010 requires that we exclude this header file. */ +#define YY_NO_UNISTD_H +%} + +%option debug +%option nodefault +%option yyclass="lispLike_Scanner" +%option noyywrap +%option c++ + + +/* . { return yytext[0]; }*/ + +%% + +[ \t\n]+ { } + + +\"[a-zA-Z0-9\-\/\(\)\. \:]+\" { + yylval->sval = STOKEN( yytext ); + return( token::VALUE ); + } + +\([a-zA-Z0-9]+ { + yylval->sval = STOKEN( yytext ); + return( token::NODE ); + } + + +\) { + return( token::CLOSENODE ); + } + + +[a-zA-Z0-9\-\/\.\_\~\?\*]+ { + yylval->sval = STOKEN( yytext ); + return( token::VALUE ); + } + + + +\"\" { + yylval->sval = STOKEN( yytext ); + return( token::VALUE ); + } + + +.|\n {} + + +%% + + + + + + + diff --git a/qilib/parsers/Flex_Bison_FIles/lispLike.yy b/qilib/parsers/Flex_Bison_FIles/lispLike.yy new file mode 100644 --- /dev/null +++ b/qilib/parsers/Flex_Bison_FIles/lispLike.yy @@ -0,0 +1,77 @@ +%skeleton "lalr1.cc" +//%require "3.0" +%debug +%defines +%define namespace "QIlib" +%define parser_class_name "lispLike_Parser" + +%code requires{ + #include + namespace QIlib { + class lispLike_Driver; + class lispLike_Scanner; + } +} + +%lex-param { QIlib::lispLike_Scanner &scanner } +%parse-param { QIlib::lispLike_Scanner &scanner } + +%lex-param { QIlib::lispLike_Driver &driver } +%parse-param { QIlib::lispLike_Driver &driver } + +%code{ + #include + #include + #include + /* include for all driver functions */ + #include + + /* this is silly, but I can't figure out a way around */ + static int yylex(QIlib::lispLike_Parser::semantic_type *yylval, + QIlib::lispLike_Scanner &scanner, + QIlib::lispLike_Driver &driver); + + +} + +/* token types */ +%union { + QString* sval; +} + +//%token END 0 "end of file" +%token VALUE +%token NODE +%token CLOSENODE + +/* destructor rule for objects */ +%destructor { if ($$) { delete ($$); ($$) = NULL; } } + + +%% + +PartNode + : NODE { driver.add_node( *$1 ); } + | PartNode NODE { driver.add_node( *$2 ); } + | PartNode VALUE { driver.add_value( *$2 ); } + | PartNode CLOSENODE { driver.close_node(); } + + +%% + + +void QIlib::lispLike_Parser::error(const location_type& loc, const std::string &err_message ) +{ + std::cerr << "Error: " << err_message << "\n"; +} + + +/* include for access to scanner.yylex */ +#include "lispLike_scanner.h" + +static int yylex( QIlib::lispLike_Parser::semantic_type *yylval, + QIlib::lispLike_Scanner &scanner, + QIlib::lispLike_Driver &driver ) +{ + return( scanner.yylex(yylval) ); +} diff --git a/qilib/parsers/lispLike_driver.cpp b/qilib/parsers/lispLike_driver.cpp new file mode 100644 --- /dev/null +++ b/qilib/parsers/lispLike_driver.cpp @@ -0,0 +1,133 @@ +/*Mainly copied from http://research.engineering.wustl.edu/~beardj/FlexBisonC++.html*/ +#include "lispLike_driver.h" +#include + +QIlib::lispLike_Driver::lispLike_Driver() + :parser( NULL ),scanner( NULL ) +{ + currentNode = &rootNode; +} + +QIlib::lispLike_Driver::~lispLike_Driver() +{ + delete(scanner); + scanner = NULL; + delete(parser); + parser = NULL; +} + +bool QIlib::lispLike_Driver::parse(const char *filename) +{ + if(filename!=NULL) + { + std::ifstream in_file( filename ); + if( ! in_file.good() ) return false; + + delete(scanner); + try + { + scanner = new QIlib::lispLike_Scanner( &in_file ); + } + catch( std::bad_alloc &ba ) + { + std::cerr << "Failed to allocate scanner: (" << + ba.what() << ")\n"; + return false; + } + + delete(parser); + try + { + parser = new QIlib::lispLike_Parser( (*scanner) /* scanner */, + (*this) /* driver */ ); + } + catch( std::bad_alloc &ba ) + { + std::cerr << "Failed to allocate parser: (" << + ba.what() << ")\n"; + return false; + } + const int accept( 0 ); + if( parser->parse() != accept ) + { + std::cerr << "Parse failed!!\n"; + return false; + } + return true; + } + return false; +} + +void QIlib::lispLike_Driver::add_node(const QString &node) +{ + QIlib::AbstractNode* newNode = new QIlib::AbstractNode(node,currentNode); + currentNode = newNode; +} + +void QIlib::lispLike_Driver::add_node(const QString &node, const QString &value) +{ + QIlib::AbstractNode* newNode = new QIlib::AbstractNode(node,value,currentNode); + currentNode = newNode; +} + +void QIlib::lispLike_Driver::add_value(const QString &value) +{ + currentNode->Values.append(value); +} + +void QIlib::lispLike_Driver::close_node() +{ + if(currentNode->parent) + currentNode = currentNode->parent; +} + + + + + + + + + + +QIlib::AbstractNode::AbstractNode(QIlib::AbstractNode *parent) +{ + this->parent =parent; + if(parent) + parent->nodes.append(this); +} + + +QIlib::AbstractNode::AbstractNode(const QString &Name, QIlib::AbstractNode *parent) + :name(Name) +{ + this->parent = parent; + if(parent) + parent->nodes.append(this); +} + + +QIlib::AbstractNode::AbstractNode(const QString &Name, const QString &Value, QIlib::AbstractNode *parent) + :name(Name) +{ + this->parent = parent; + if(parent) + parent->nodes.append(this); + Values.append(Value); +} + +QString QIlib::AbstractNode::print() +{ + QString result; + result.append(this->name+" "); + for(int i=0;inodes.count();i++) + { + result.append(this->nodes.at(i)->print()); + } + for(int i=0;iValues.count();i++) + { + result.append(Values.at(i)+" "); + } + result.append(")"); + return result; +} diff --git a/qilib/parsers/lispLike_driver.h b/qilib/parsers/lispLike_driver.h new file mode 100644 --- /dev/null +++ b/qilib/parsers/lispLike_driver.h @@ -0,0 +1,49 @@ +#ifndef LISPLIKE_DRIVER_H +#define LISPLIKE_DRIVER_H +#include +#include "lispLike_scanner.h" +#include +#include +#include +#include +#include +#include +#include + +namespace QIlib{ + +class AbstractNode +{ +public: + AbstractNode( QIlib::AbstractNode* parent=NULL); + AbstractNode(const QString& Name, QIlib::AbstractNode* parent=NULL); + AbstractNode(const QString& Name,const QString& Value, QIlib::AbstractNode* parent=NULL); + QString print(); + QList nodes; + QString name; + QStringList Values; + QIlib::AbstractNode* parent; +}; + +class lispLike_Driver +{ +public: + lispLike_Driver(); + + virtual ~lispLike_Driver(); + bool parse( const char *filename ); + void add_node( const QString &node ); + void add_node( const QString &node , const QString &value); + void add_value( const QString &value ); + void close_node(); + + +protected: + + QIlib::lispLike_Parser *parser; + QIlib::lispLike_Scanner *scanner; + QIlib::AbstractNode rootNode; + QIlib::AbstractNode* currentNode; +}; +} +#endif // LISPLIKE_DRIVER_H diff --git a/qilib/parsers/lispLike_scanner.cpp b/qilib/parsers/lispLike_scanner.cpp new file mode 100644 --- /dev/null +++ b/qilib/parsers/lispLike_scanner.cpp @@ -0,0 +1,14 @@ +#include "lispLike_scanner.h" + +QIlib::lispLike_Scanner::lispLike_Scanner(std::istream *in) + : yyFlexLexer(in), yylval( NULL ) +{ + +} + + +int QIlib::lispLike_Scanner::yylex(QIlib::lispLike_Parser::semantic_type *lval) +{ + yylval = lval; + return( yylex() ); +} diff --git a/qilib/parsers/lispLike_scanner.h b/qilib/parsers/lispLike_scanner.h new file mode 100644 --- /dev/null +++ b/qilib/parsers/lispLike_scanner.h @@ -0,0 +1,31 @@ +#ifndef LISPLIKE_SCANNER_H +#define LISPLIKE_SCANNER_H +#if ! defined(yyFlexLexerOnce) +#include +#endif +#include +#include +#include + +#undef YY_DECL +#define YY_DECL int QIlib::lispLike_Scanner::yylex() + +#include + +namespace QIlib{ + +class lispLike_Scanner : public yyFlexLexer +{ +public: + lispLike_Scanner(std::istream *in); + int yylex(QIlib::lispLike_Parser::semantic_type *lval); + +private: + /* hide this one from public view */ + int yylex(); + /* yyval ptr */ + QIlib::lispLike_Parser::semantic_type *yylval; +}; +} + +#endif // LISPLIKE_SCANNER_H diff --git a/qilib/qicadnet.cpp b/qilib/qicadnet.cpp new file mode 100644 --- /dev/null +++ b/qilib/qicadnet.cpp @@ -0,0 +1,17 @@ +#include "qicadnet.h" + +QIlib::QIcadNet::QIcadNet() +{ +} + +QIlib::QIcadNet::~QIcadNet() +{ + +} + + +QIlib::QIcadNetNode::QIcadNetNode(QString ref, QString node) +{ + this->p_ref = ref; + this->p_node = node; +} diff --git a/qilib/qicadnet.h b/qilib/qicadnet.h new file mode 100644 --- /dev/null +++ b/qilib/qicadnet.h @@ -0,0 +1,31 @@ +#ifndef QINET_H +#define QINET_H +#include +#include + +namespace QIlib{ +class QIcadNetNode +{ +public: + QIcadNetNode(QString ref,QString node); + QString ref(){return this->p_ref;} + QString node(){return this->p_node;} +private: + QString p_ref; + QString p_node; +}; + +class QIcadNet +{ +public: + QIcadNet(); + ~QIcadNet(); + int code(); + QString name(); +private: + int p_code; + QString p_name; + QList p_nodes; +}; +} +#endif // QINET_H diff --git a/qilib/qicadnetlist.cpp b/qilib/qicadnetlist.cpp new file mode 100644 --- /dev/null +++ b/qilib/qicadnetlist.cpp @@ -0,0 +1,132 @@ +#include "qicadnetlist.h" +#include + + +const char* root_c ="(export"; +const char* version_c ="(version"; +const char* design_c ="(design"; +const char* source_c ="(source"; +const char* date_c ="(date"; +const char* tool_c ="(tool"; +const char* components_c ="(components"; +const char* component_c ="(comp"; +const char* ref_c ="(ref"; +const char* value_c ="(value"; +const char* libsource_c ="(libsource"; +const char* lib_c ="(lib"; +const char* part_c ="(part"; +const char* sheetpath_c ="(sheetpath"; +const char* names_c ="(names"; +const char* tstamps_c ="(tstamps"; +const char* tstamp_c ="(tstamp"; +const char* libparts_c ="(libparts"; +const char* libpart_c ="(libpart"; +const char* fields_c ="(fields"; +const char* field_c ="(field"; +const char* name_c ="(name"; +const char* pins_c ="(pins"; +const char* pin_c ="(pin"; +const char* num_c ="(num"; +const char* type_c ="(type"; +const char* libraries_c ="(libraries"; +const char* library_c ="(library"; +const char* logical_c ="(logical"; +const char* uri_c ="(uri"; +const char* nets_c ="(nets"; +const char* net_c ="(net"; +const char* code_c ="(code"; +const char* node_c ="(node"; + + +QIlib::QIcadNetList::QIcadNetList() +{ + +} + + +bool QIlib::QIcadNetList::parseNetList(const QString &netlist) +{ + + parse(netlist.toStdString().c_str()); + updateConcreteTree(); + return false; +} + +QString QIlib::QIcadNetList::print() +{ + return rootNode.print(); +} + +QIlib::AbstractNode *QIlib::QIcadNetList::getAbstractNode(const QString &node, int index) +{ + return getAbstractNode(&rootNode,node,&index); +} + +QIlib::AbstractNode *QIlib::QIcadNetList::getAbstractNode(QIlib::AbstractNode *rootNode, const QString &node, int* index) +{ + for(int i=0;inodes.count();i++) + { + if(rootNode->nodes.at(i)->name==node) + { + if((*index)==0) + { + return rootNode->nodes.at(i); + } + (*index)-=1; + } + else + { + if(0nodes.at(i)->nodes.count()) + { + QIlib::AbstractNode *result=getAbstractNode(rootNode->nodes.at(i),node,index); + if(NULL!=result)return result; + } + } + } + return NULL; +} + +/* + QString version; + QIcadNetListDesign design; + QList components; + QList libparts; + QIcadNetListLevel rootSheet; +*/ + +#define setVal(dest,node,name,index) \ + (node) = getAbstractNode((name),(index));\ + if(((node)!=NULL)&&(0<(node)->Values.count())) \ +{\ + (dest) = (node)->Values.at(0); \ + } \ + + +void QIlib::QIcadNetList::updateConcreteTree() +{ + QIlib::AbstractNode *node; + setVal(this->version,node,QIlib::Lexique::version_c,0); + setVal(this->design.date,node,QIlib::Lexique::date_c,0); + setVal(this->design.source,node,QIlib::Lexique::source_c,0); + setVal(this->design.tool,node,QIlib::Lexique::tool_c,0); + this->design.date.clear(); +} + + + + + +QIlib::QIcadAbstractNodeWrapper::QIcadAbstractNodeWrapper() +{ + +} + +QIlib::QIcadAbstractNodeWrapper::~QIcadAbstractNodeWrapper() +{ + /*First delete all the childs*/ + for(int i=0;ichilds.count();i++) + { + if(this->childs.at(i)) + delete this->childs.at(i); + } +} diff --git a/qilib/qicadnetlist.h b/qilib/qicadnetlist.h new file mode 100644 --- /dev/null +++ b/qilib/qicadnetlist.h @@ -0,0 +1,144 @@ +#ifndef QICADNETLIST_H +#define QICADNETLIST_H +#include +#include +#include +#include +#include +#include + +namespace QIlib{ + +namespace Lexique +{ +extern "C" const char* root_c ; +extern "C" const char* version_c ; +extern "C" const char* design_c ; +extern "C" const char* source_c ; +extern "C" const char* date_c ; +extern "C" const char* tool_c ; +extern "C" const char* components_c ; +extern "C" const char* component_c ; +extern "C" const char* ref_c ; +extern "C" const char* value_c ; +extern "C" const char* libsource_c ; +extern "C" const char* lib_c ; +extern "C" const char* part_c ; +extern "C" const char* sheetpath_c ; +extern "C" const char* names_c ; +extern "C" const char* tstamps_c ; +extern "C" const char* tstamp_c ; +extern "C" const char* libparts_c ; +extern "C" const char* libpart_c ; +extern "C" const char* fields_c ; +extern "C" const char* field_c ; +extern "C" const char* name_c ; +extern "C" const char* pins_c ; +extern "C" const char* pin_c ; +extern "C" const char* num_c ; +extern "C" const char* type_c ; +extern "C" const char* libraries_c ; +extern "C" const char* library_c ; +extern "C" const char* logical_c ; +extern "C" const char* uri_c ; +extern "C" const char* nets_c ; +extern "C" const char* net_c ; +extern "C" const char* code_c ; +extern "C" const char* node_c ; + +} + +class QIcadNetListLevel +{ +public: + QIcadNetListLevel() {} + QList sublevels; + QList nets; +}; + +class QIcadNetListDesign +{ +public: + QIcadNetListDesign(){} + QString source; + QString date; + QString tool; +}; + +class QIcadNetListComponent +{ +public: + typedef struct libsource_t + { + QString lib; + QString part; + }libsource_t; + typedef struct sheetpath_t + { + QString names; + QString tstamp; + }sheetpath_t; + QIcadNetListComponent(){} + QString ref; + QString value; + QString tstamp; + libsource_t libsource; + sheetpath_t sheetpath; +}; + +class QIcadNetListLibPart +{ +public: + typedef struct fields_t + { + QString ref; + QString value; + QString footprint; + QString datasheet; + }fields_t; + typedef struct pin_t + { + int num; + QString name; + QString type; + }pin_t; + QIcadNetListLibPart(); + QString lib; + QString part; + QStringList footprints; + fields_t fields; + QList pins; +}; + +class QIcadAbstractNodeWrapper +{ +public: + QIcadAbstractNodeWrapper(); + ~QIcadAbstractNodeWrapper(); + QString value(); + QList childs; + QIcadAbstractNodeWrapper* parent; +private: + QIlib::AbstractNode* node; +}; + +class QIcadNetList : private lispLike_Driver +{ +public: + QIcadNetList(); + bool parseNetList(const QString& netlist); + QString toString(); + QString fileName; + QString version; + QIcadNetListDesign design; + QList components; + QList libparts; + QIcadNetListLevel rootSheet; + QString print(); +private: + QIlib::AbstractNode* getAbstractNode(const QString& node,int index); + QIlib::AbstractNode* getAbstractNode(QIlib::AbstractNode* rootNode,const QString& node,int* index); + void updateConcreteTree(); +}; +} +#endif // QICADNETLIST_H diff --git a/qilib/qilib.prf b/qilib/qilib.prf new file mode 100644 --- /dev/null +++ b/qilib/qilib.prf @@ -0,0 +1,23 @@ +#================================================== +# +# _|_| _|_|_| _| _| _| +# _| _| _| _| _|_|_| +# _| _|_| _| _| _| _| _| +# _| _| _| _| _| _| _| +# _|_| _| _|_|_| _| _| _|_|_| +# +#================================================== +# +# + + + +INCLUDEPATH += $$[QT_INSTALL_HEADERS]/QIlib + +LIBS += -lQIlib -lfl + + + + + + diff --git a/qilib/qilib.pro b/qilib/qilib.pro new file mode 100644 --- /dev/null +++ b/qilib/qilib.pro @@ -0,0 +1,64 @@ +#================================================== +# +# _|_| _|_|_| _| _| _| +# _| _| _| _| _|_|_| +# _| _|_| _| _| _| _| _| +# _| _| _| _| _| _| _| +# _|_| _| _|_|_| _| _| _|_|_| +# +#================================================== +# +# + +QT += core gui + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = QIlib +TEMPLATE = lib + +LIBS += -lfl + +MOC_DIR = moc +RCC_DIR = resources +OBJECTS_DIR = obj +DESTDIR = lib + +include ( ./parsers/Flex_Bison_FIles/Flex_Bison_FIles.pri ) + +qilibcfg.path = $$[QT_INSTALL_PREFIX]/mkspecs/features +qilibcfg.files = \ + qilib.prf + +target.path = $$[QT_INSTALL_LIBS] + +qilibHeaders.path = $$[QT_INSTALL_HEADERS]/QIlib +qilibHeaders.files = \ + qicadnetlist.h \ + qicadnet.h \ + +qilibParsersHeaders.path = $$[QT_INSTALL_HEADERS]/QIlib/parsers +qilibParsersHeaders.files = \ + parsers/lispLike_driver.h \ + parsers/lispLike_scanner.h + + +INSTALLS += target qilibHeaders qilibParsersHeaders qilibcfg + +INCLUDEPATH += ./parsers + +SOURCES += \ + qicadnetlist.cpp \ + qicadnet.cpp \ + parsers/lispLike_driver.cpp \ + parsers/lispLike_scanner.cpp + + +HEADERS += \ + qicadnetlist.h \ + qicadnet.h \ + parsers/lispLike_driver.h \ + parsers/lispLike_scanner.h + +OTHER_FILES += qilib.prf + diff --git a/test/dumpLispLikeFiles/dumpLispLikeFiles.pro b/test/dumpLispLikeFiles/dumpLispLikeFiles.pro new file mode 100644 --- /dev/null +++ b/test/dumpLispLikeFiles/dumpLispLikeFiles.pro @@ -0,0 +1,45 @@ +QT += core gui +CONFIG += qilib + +greaterThan(QT_MAJOR_VERSION, 4): QT += widgets + +TARGET = LispLikeDump +TEMPLATE = app +MOC_DIR = moc +RCC_DIR = resources +OBJECTS_DIR = obj +DESTDIR = bin + +SOURCES += main.cpp + +FILESTOCOPY.files += \ + $${PWD}/../testFiles/netlist1.net \ + $${PWD}/../testFiles/netlist2.net \ + $${PWD}/../testFiles/pcb1.kicad_pcb + +FILESTOCOPY.path = $${DESTDIR} + +message($${DESTDIR}) + +defineTest(copyFiles) { + files = $$1 + DDIR = $$2 + win32:DDIR ~= s,/,\\,g + QMAKE_POST_LINK += $$QMAKE_MKDIR $$quote($$DDIR) $$escape_expand(\\n\\t) + for(FILE, files) { + message(copying file $$FILE to $$DIR) + # Replace slashes in paths with backslashes for Windows + win32:FILE ~= s,/,\\,g + QMAKE_POST_LINK += $$QMAKE_COPY $$quote($$FILE) $$quote($$DDIR) $$escape_expand(\\n\\t) + } + export(QMAKE_POST_LINK) +} + + + +!isEmpty(FILESTOCOPY.files) { + copyFiles($$FILESTOCOPY.files,$$FILESTOCOPY.path) +} + + + diff --git a/test/dumpLispLikeFiles/main.cpp b/test/dumpLispLikeFiles/main.cpp new file mode 100644 --- /dev/null +++ b/test/dumpLispLikeFiles/main.cpp @@ -0,0 +1,27 @@ +#include +#include +#include +#include +#include +#include +/* +#include +*/ + +int main(int argc, char *argv[]) +{ + QApplication ap(argc,argv); + QIlib::QIcadNetList NetListdriver; + if(argc>1) + { + if(QFile::exists(argv[1])) + { + QTime tm; + tm.start(); + NetListdriver.parseNetList(argv[1]); + qDebug()<<"File parsed in "<