Revisão | 5f1b122c9ce7e2bd0d1c5de272477a26f9f4c24d (tree) |
---|---|
Hora | 2022-10-24 05:47:01 |
Autor | Albert Mietus < albert AT mietus DOT nl > |
Commiter | Albert Mietus < albert AT mietus DOT nl > |
asis
@@ -7,7 +7,7 @@ | ||
7 | 7 | ============== |
8 | 8 | |
9 | 9 | |
10 | -.. post:: | |
10 | +.. post:: | |
11 | 11 | :category: Castle, Usage, |
12 | 12 | :tags: Castle, Tools, DRAFT |
13 | 13 |
@@ -18,8 +18,7 @@ | ||
18 | 18 | Probably you have many questions about the software. About its `metrics |
19 | 19 | <https://en.wikipedia.org/wiki/Software_metric>`__: like the `Fan-Out |
20 | 20 | <https://en.wikipedia.org/wiki/Fan-out_(software)>`__ of a given class or its `Cyclomatic-Complexity |
21 | - <https://en.wikipedia.org/wiki/Cyclomatic_complexity>`__. Or merely like to know which components are connected. | |
22 | - |BR| | |
21 | + <https://en.wikipedia.org/wiki/Cyclomatic_complexity>`__. Or merely like to k | |
23 | 22 | Often this isn’t too complicated. But the amount of error-prone work is dramatic. Castle comes with tools that |
24 | 23 | provide the answer. |
25 | 24 |
@@ -27,19 +26,59 @@ | ||
27 | 26 | Classic tools are not sufficient |
28 | 27 | ================================ |
29 | 28 | |
30 | -Most languages come with a compiler_ and optional a debugger_. The compiler_ (and its companions: linker, loader) | |
29 | +Most languages come with a compiler_ and, optional a debugger_. The compiler_ (and its companions: linker, loader) | |
31 | 30 | translate files with source code into *computer code*; often called the “binaries”. Nowadays, an “optimiser_” is usually |
32 | 31 | build-in to unburden the developer from details that make the code more efficient. So that (s)he can make code readable |
33 | -and maintainable. For example, by employing extra local, well-named variables that do not result in more memory use; | |
34 | -the use of convenient loops, which are unrolled automatically, etc. Originally, the intent was to optimise binaries; | |
35 | -but they help to improve the source for developers too. | |
32 | +and maintainable. For example, by defining extra, well-named variables that do not result in more memory use; | |
33 | +the use of convenient loops, which are unrolled automatically, etc. | |
36 | 34 | |BR| |
35 | +Originally, the intent was to optimise binaries; but they help to improve the source for developers too. | |
36 | + | |
37 | 37 | The second well-known tool is the “source-level debugger_\”. It understands the binary and can correlate that with the |
38 | -source code -- which isn’t trivial, especially not due to the optimiser_. It is an awesome tool when there is a bug in | |
38 | +source code -- which isn’t trivial, especially due to the optimiser_. It is an awesome tool when there is a bug in | |
39 | 39 | the code; as the developer can step “line by line” through the source code, examine in-between results, and even change |
40 | -some parameters on the fly. Once this was the only way to improve code. In the present day, we have other instruments | |
41 | -too; like Test-Driven-Development to prevent the nastiest flows in the first place. | |
40 | +some parameters on the fly. | |
41 | +|BR| | |
42 | +Once this was the only way to improve code. In the present day, we have other instruments too; like | |
43 | +Test-Driven-Development to prevent the nastiest flows in the first place. | |
42 | 44 | |
45 | +|BR| | |
46 | +----- | |
47 | + | |
48 | +TODO | |
49 | +==== | |
50 | + | |
51 | +* Explore | |
52 | + | |
53 | + - Simulate | |
54 | + | |
55 | + - https://dezyne.org/dezyne/manual/dezyne/html_node/Invoking-dzn-simulate.html | |
56 | + | |
57 | + - Vizualize (show) | |
58 | + | |
59 | + | |
60 | +* Verification & Validation (https://en.wikipedia.org/wiki/Software_verification_and_validation) | |
61 | + | |
62 | + - https://dezyne.org/dezyne/manual/dezyne/html_node/Invoking-dzn-verify.html | |
63 | + | |
64 | +* Trace, Debug, Log/Monitor | |
65 | + | |
66 | +* Query/Metrics (https://en.wikipedia.org/wiki/Software_metric) | |
67 | + | |
68 | + - Cyclomatic_complexity https://en.wikipedia.org/wiki/Cyclomatic_complexity | |
69 | + | |
70 | + - ? Fan-In/Out https://en.wikipedia.org/wiki/Fan-out_(software), UncleBob | |
71 | + | |
72 | + | |
73 | + | |
74 | + | |
75 | + | |
76 | +---------- | |
77 | + | |
78 | +.. rubric:: Footnotes | |
79 | + | |
80 | +.. [#XXXX] | |
81 | + XXXX | |
43 | 82 | |
44 | 83 | .. _Software_metric: https://en.wikipedia.org/wiki/Software_metric |
45 | 84 | .. _Fan-Out: https://en.wikipedia.org/wiki/Fan-out_(software) |
@@ -32,9 +32,9 @@ | ||
32 | 32 | The lexer will recognize some tokes that are specialy for python, like `INDENT` & `DEDENT`. Also some generic tokens |
33 | 33 | like NAME (which is an ID) and `NUMBER` are know, and can be used to define the language. |
34 | 34 | |
35 | -Unfortunally, it will also find some tokens --typical operators-- that *hardcoded* for python. By we like to use | |
36 | -differently. Possible combined with other characters. Then, those will not be found; not the literal-strings as set in | |
37 | -the grammar. | |
35 | +Unfortunally, it will also find some tokens --typical operators-- that *hardcoded* for python. Even when we like to use | |
36 | +them differently; possible combined with other characters. Then, those will not be found; not the literal-strings as set | |
37 | +in the grammar. | |
38 | 38 | |
39 | 39 | .. warning:: |
40 | 40 |
@@ -43,13 +43,13 @@ | ||
43 | 43 | Left_arrow_BAD: '<-' ## This is WRONG, as ``<`` is sees as a token |
44 | 44 | Left_arrow_OKE: '<' '-' ## This is acceptable |
45 | 45 | |
46 | -.. seealso:: https://docs.python.org/3/library/token.html | |
47 | - | |
46 | +.. seealso:: https://docs.python.org/3/library/token.html for an overiew of the predefied tokens | |
47 | + | |
48 | 48 | .. tip:: |
49 | 49 | |
50 | - A quick trick to see how a file is split in tokens, use ``python -m tokenize [-e] filename.peg``. | |
50 | + A quick trick to see how a file is split into tokens, use ``python -m tokenize [-e] filename.peg``. | |
51 | 51 | |BR| |
52 | - And make sure you do not use string-literals that (eg) are composed of two tokens. | |
52 | + Make sure you do not use string-literals that (eg) are composed of two tokens. | |
53 | 53 | |
54 | 54 | |
55 | 55 |