GithubHelp home page GithubHelp logo

xaizek / zograscope Goto Github PK

View Code? Open in Web Editor NEW
48.0 5.0 2.0 3.61 MB

Mainly a syntax-aware diff that also provides a number of additional tools.

License: GNU Affero General Public License v3.0

Makefile 1.09% C 0.23% C++ 95.19% Lex 2.76% QMake 0.09% HTML 0.51% Shell 0.13%
agpl agplv3 cpp cpp11 command-line-tool command-line-app command-line-tools syntax-aware diff diffing

zograscope's Introduction

zograscope, 2017 - 2024

Screenshot

Clone recursively, there are submodules:

git clone --recursive https://github.com/xaizek/zograscope.git
  1. Description (Status; Supported languages; Configuration)
  2. Tools
  3. Building and Installing (Dependencies)
  4. Documentation
  5. License
  6. Credits (References)

Name

"A zograscope is an optical device for enhancing the sense of depth perception from a flat picture." (wiki)

Description

zograscope is built around syntax-aware diff and includes a number of additional tools.

The nature of syntax-aware diff requires knowledge of structure of the code, which can be used to build other simple tools that can benefit from this information. Competing with real language front-ends in the level of accuracy is not possible, but making some things that are one step further than regular text-processing utilities seems feasible and the result might be even more practical than some of the more elaborate tools which end up requiring complicated setup process.

Status

The project is work in progress, but is useful in its current state.

Code isn't perfect and isn't extensively documented as initial version was more of an experiment, but this situation gets better.

Documentation

See the manual page.

Tools

A terminal-based syntax-aware diff.

Grep-like tool that finds elements of source code structure.

A Qt5 GUI version of syntax-aware diff.

Simple syntax highlighter for xterm-256color palette.

Counter of lines of code.

TUI interface with underdefined scope of functionality.

Building and Installing

# if Qt5 is available (use `qmake` if it corresponds to Qt5 on your machine)
echo 'QT5_PROG := qmake-qt5' >> config.mk
# if libgit2 is present
echo 'HAVE_LIBGIT2 := yes'   >> config.mk
# if libsrcml is present
echo 'HAVE_LIBSRCML := yes'  >> config.mk
# if cursesw is present
echo 'HAVE_CURSESW := yes'   >> config.mk

make release check

This will build release version and run tests. The executables will be named release/zs-*.

There is no data, so just making them available in the $PATH will work. However, it's possible to install conventionally (/usr prefix by default):

make install

DESTDIR and PREFIX can be set to modify destination location. On invoking make uninstall same values of these values should be specified.

Dependencies

  • GNU Make
  • C++11-capable compiler (GCC 4.9 has some issues, GCC 5.3 works fine)
  • flex
  • GNU Bison v3+
  • Boost, tested with 1.58, but older versions might work too
  • (optional, run- or build-time, for C++) srcml (v0.9.5 and v1.0.0 were tested)
  • (optional, for gdiff tool) qt5
  • (optional, for gdiff tool) libgit2
  • (optional, for tui tool) curses with support of wide characters
  • (optional) pandoc for regenerating man pages

For Debian-based distributions

If you are using Debian or one of its derivatives, you can install the dependencies as follows:

# install make and build tools
sudo apt install -y build-essential
# installing dependencies
sudo apt install -y libboost-filesystem-dev libboost-iostreams-dev
sudo apt install -y libboost-program-options-dev libboost-system-dev
sudo apt install -y libarchive13
sudo apt install -y bison flex
# installing srcml
wget http://131.123.42.38/lmcrs/beta/srcML-Ubuntu18.04.deb
sudo apt install ./srcML-Ubuntu18.04.deb

You can also check out the CI build script in case dependencies change in the future.

License

AGPLv3

Version 3 of the GNU Affero General Public License.

Credits

dtl library is used for finding edit distance.

pmr implementation from C++17 with a small addition is employed for custom allocators.

TinyXML2 is used for parsing XML.

tree-sitter is used for parsing of some languages.

Catch2 is used for tests.

References

Change Distilling: Tree Differencing for Fine-Grained Source Code Change Extraction. Beat Fluri, Michael Würsch, Martin Pinzger, and Harald C. Gall. 2007.

Change Detection in Hierarchically Structured Information. Sudarshan Chawathe, Hector Garcia-molina and Jennifer Widom. 1996.

Simple fast algorithms for the editing distance between trees and related problems. Kaizhong Zhang and Dennis Shasha. 1989.

zograscope's People

Contributors

amejiarosario avatar xaizek avatar

Stargazers

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

Watchers

 avatar  avatar  avatar  avatar  avatar

zograscope's Issues

Javascript support

Hi, I'm on the lookout for a patch tool whose intelligence stretches beyond linenumbers, that can be run in a post-install script.

Zograscope looks interesting. Are there any plans on adding javascript support?

Makefile parser error: syntax error, unexpected include, expecting WS or NL or LEADING_TAB

../nuttx/drivers/wireless/spirit/Make.defs:41:39: parse error: syntax error, unexpected include, expecting WS or NL or LEADING_TAB
Failed to parse: ../nuttx/drivers/wireless/spirit/Make.defs
ifeq ($(CONFIG_WL_SPIRIT),y)

# Include Spirit library support

include wireless$(DELIM)spirit$(DELIM)lib$(DELIM)Make.defs
include wireless$(DELIM)spirit$(DELIM)include$(DELIM)Make.defs
include wireless$(DELIM)spirit$(DELIM)drivers$(DELIM)Make.defs

endif

Installation instructions

Hi,
This project looks great and I'd like to try it out. However, I'm new to C++ and having some difficulties installing the program.

Could you please provide instructions how to get the dependencies installed (e.g., Boost)?

image

Build fails in macOS

Fresh clone and I get this:

➜  zograscope git:(master) make
c++ -c -I./src/ -std=c++11 -Wall -Wextra -MMD -Isrc/ -Ithird-party/ -DYYDEBUG -Og -g tools/diff/diff.cpp -o tools/diff/diff.o
error: invalid integral value 'g' in '-Og'
error: invalid integral value 'g' in '-Og'

Compiler info:

➜  zograscope git:(master) clang --version
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.7.0
Thread model: posix
InstalledDir: /Applications/Xcode81.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Makefile parser error: syntax error, unexpected SLIT

../nuttx/arch/avr/src/avr/Toolchain.defs:92:11: parse error: syntax error, unexpected SLIT
Failed to parse: ../nuttx/arch/avr/src/avr/Toolchain.defs

Points to this:

  $(error "No valid CONFIG_ARCH_CHIP_ set in the configuration")

Full file: https://gist.github.com/tritao/352281e9dee9d8832c51772378b92102

I get the same reported error message for this as well:

LIBGCC = ${shell "$(CC)" $(ARCHCPUFLAGS) -print-libgcc-file-name}

Probably the same issue.

Another instance:

  CUSTOM_DIR = $(patsubst "%",%,$(CONFIG_ARCH_BOARD_CUSTOM_DIR))

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.