Permalink
Browse files

Minor code documentation clean-up.

  • Loading branch information...
1 parent 6c2bf04 commit 4001d89804c91513c936cacfc49585e5240d091e @tpircher committed Jun 11, 2012
Showing with 48 additions and 27 deletions.
  1. +13 −0 ChangeLog
  2. +10 −1 README
  3. +0 −1 crc_lexer.py
  4. +1 −1 crc_models.py
  5. +6 −6 crc_opt.py
  6. +18 −18 crc_parser.py
View
@@ -1,3 +1,16 @@
+#
+# Version 0.7.11, 2012-??-??
+#
+
+2012-02-26 Thomas Pircher <tehpeh@gmx.net>
+
+ * crc_symtable.py:
+ * pycrc.py:
+ Improved Python3 compatibility. pycrc now requires Python 2.6 or later.
+
+ * test/test.py:
+ Added a test for compiled standard models.
+
2012-02-26 Thomas Pircher <tehpeh@gmx.net>
* crc_models.py:
View
11 README
@@ -6,7 +6,6 @@
| .__/ \__, |\___|_| \___|
|_| |___/
-
http://www.tty1.net/pycrc/
@@ -34,6 +33,7 @@ Then the script can be called like an application.
./pycrc.py [options]
+
Getting help
============
@@ -56,6 +56,15 @@ Thanks for your collaboration.
Also see http://www.tty1.net/pycrc/faq.html for frequently asked questions.
+
+Donate
+======
+
+If you like pycrc and you would like to donate, please see my Amazon wishlist:
+http://www.amazon.co.uk/registry/wishlist/3LXEZGUTVJ3AW
+
+
+
Copyright of the generated source code
======================================
View
@@ -213,7 +213,6 @@ def _parse_gibberish(self):
# check for malformed "$"
if self.input_str[0] == "$":
self.text = self.input_str[0:1]
- # self.input_str = self.input_str[1:]
return self.tok_unknown
# the character is gibberish.
View
@@ -361,7 +361,7 @@ def getList(self):
###############################################################################
def getParams(self, model):
"""
- This function returns the paremeters of a given model.
+ This function returns the parameters of a given model.
"""
model = model.lower();
for i in self.models:
View
@@ -182,27 +182,27 @@ def parse(self, argv = None):
undefined_params = []
if options.width != None:
- self.Width = options.width
+ self.Width = options.width
else:
undefined_params.append("--width")
if options.poly != None:
- self.Poly = options.poly
+ self.Poly = options.poly
else:
undefined_params.append("--poly")
if options.reflect_in != None:
- self.ReflectIn = options.reflect_in
+ self.ReflectIn = options.reflect_in
else:
undefined_params.append("--reflect-in")
if options.xor_in != None:
- self.XorIn = options.xor_in
+ self.XorIn = options.xor_in
else:
undefined_params.append("--xor-in")
if options.reflect_out != None:
- self.ReflectOut = options.reflect_out
+ self.ReflectOut = options.reflect_out
else:
undefined_params.append("--reflect-out")
if options.xor_out != None:
- self.XorOut = options.xor_out
+ self.XorOut = options.xor_out
else:
undefined_params.append("--xor-out")
if options.table_idx_width != None:
View
@@ -87,38 +87,38 @@ def __init__(self, opt):
# function parse
#
# The used grammar is:
- # term: LITERAL
- # | IDENTIFIER
- # | '(' or_exp ')'
- # ;
- #
- # comp_exp: term OP_COMPARISON term
+ # data: /* empty */
+ # | data GIBBERISH
+ # | data IDENTIFIER
+ # | data '{:' data ':}'
+ # | data if_block
# ;
#
- # and_exp: term
- # | and_exp OP_AND comp_exp
+ # if_block: IF '(' exp_or ')' '{:' data ':}' elif_blocks else_block
# ;
#
- # or_exp: and_exp
- # | or_exp OP_OR and_exp
+ # elif_blocks: /* empty */
+ # | elif_blocks ELIF '(' exp_or ')' '{:' data ':}'
# ;
#
# else_block: /* empty */
# | ELSE '{:' data ':}'
# ;
#
- # elif_blocks: /* empty */
- # | elif_blocks ELIF '(' or_exp ')' '{:' data ':}'
+ # exp_or: exp_and
+ # | exp_or TOK_OR exp_and
# ;
#
- # if_block: IF '(' or_exp ')' '{:' data ':}' elif_blocks else_block
+ # exp_and: term
+ # | exp_and TOK_AND exp_comparison
# ;
#
- # data: /* empty */
- # | data GIBBERISH
- # | data IDENTIFIER
- # | data '{:' data ':}'
- # | data if_block
+ # exp_comparison: term TOK_COMPARISON term
+ # ;
+ #
+ # term: LITERAL
+ # | IDENTIFIER
+ # | '(' exp_or ')'
# ;
###############################################################################
def parse(self, in_str):

0 comments on commit 4001d89

Please sign in to comment.