Skip to content

Add dependency graph functionality #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

teodutu
Copy link
Member

@teodutu teodutu commented Apr 27, 2021

Changes:

  • SandScout Compiler can now return the rules it discovers as a dictionary of lists.
  • When the script is imported, only the dictionary output is supported.
  • When called directly, the script uses argparse to be more verbose about its parameters.
  • Converted the script to Python3.
  • Improved coding style consistency.
  • Increased tab size to 4 spaces.
  • TODOs still present from before.

Changes:
- SandScout Compiler can now return the rules it discovers as a dictionary of lists.
- When the script is imported, only the dictionary output is supported.
- When called directly, the script uses argparse to be more verbose about its parameters.
- Converted the script to Python3
- Improved coding style consistency.
- Increased tab size to 4 spaces.
- TODOs still present from before.
@razvand razvand self-requested a review May 2, 2021 13:49
@razvand razvand self-assigned this May 2, 2021
Copy link
Member

@razvand razvand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this. Please address my comments that mostly deal with the old version of the code. But, as long as you worked on it, it makes sense to improve it further.

_DEFAULT_OP = ''
_GRAPH = {}
_CMD_ARGS = None

# Regular expression rules for simple tokens
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These expressions are not used in the program.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They are. ply requires a set of tokens that it tries to match against the input file. They are declared in the tokens list above



def main():
_get_args()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this using and underscore prefix? Is there a Python naming convention for this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. They're somewhat similar to static functions in C. If someone were to from sandscout_compiler import * [1], symbols starting with _ would not be visible. However, when importing the file like this import sandscout_compiler, all symbols, regardless of names, would be imported.

[1] https://www.python.org/dev/peps/pep-0008/#descriptive-naming-styles

Changes:
- Fix all pycodestyle errors and those pylint errors that don't affect the
functionality of the code
- Add docstrings to all functions and to the script itself
- Replace camelCase with snake_case
teodutu added 2 commits May 15, 2021 23:36
The output of the SandScout compiler differed in certain aspects from
that of SandBlaster. Now those differences have been eliminated.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants