Skip to content

Commit 5a02768

Browse files
authored
Minor docs/Markdown updates (#328)
* Mostly validates new machine config. * Added editorconfig setting for a guideline in markdown files. * Simplifies visualizing limits of lines without split screen "preview" showing. This makes editing markdown files easier and keeps them all releatively consistent. * It's just a "guideline" no hard rule! Anything can go past it but that should be kept to a bare minimun (Some things like links are allowed to go longer)
1 parent 340edca commit 5a02768

4 files changed

Lines changed: 33 additions & 23 deletions

File tree

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ indent_style = space
2727
indent_size = 2
2828
tab_width = 2
2929

30+
[*.md]
31+
# mark left margion for split screen preview of markdown files
32+
# requires: https://marketplace.visualstudio.com/items?itemName=PaulHarrington.EditorGuidelinesPreview
33+
guidelines = 92
34+
3035
# match ISO standard requirement for C/C++
3136
[*.c,*.h,*.cpp]
3237
insert_final_newline = true

src/Samples/Kaleidoscope/Kaleidoscope-Overview.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@ follow along both tutorials to see how the various LLVM concepts are projected i
1313
>[!NOTE]
1414
> The samples are all setup to include `<PublishAot>True</PublishAot>` and therefore
1515
> support AOT code generation. To use that you only need to run
16-
> `dotnet publish <project path> -r win-x64` to build the native standalone version
16+
> `dotnet publish <project path> -r <RID>` to build the native standalone version
1717
> of the app. This demonstrates that the libraries are AOT compatible. While this makes
18-
> things run faster as no JIT used, everything is already native code, it has the
18+
> things run faster as no JIT is used, everything is already native code, it has the
1919
> drawback of making the app RID specific. That is, you must AOT build for EVERY
20-
>supported RID target. Thus, every use must make a choice and there is no single
21-
> "one size fits all" answer.
20+
> supported RID target. Each usage case must make a choice and there is no single
21+
> "one size fits all" answer. Thus, the samples and the library itself allow for, but
22+
> ***Do NOT*** require AOT builds.
2223
2324
## Overview
2425
Kaleidoscope is a simple functional language that is used to illustrate numerous real

src/Samples/Kaleidoscope/Kaleidoscope.Grammar/ANTLR/Kaleidoscope-ParseTreeVisitor.md

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,28 @@ uid: Kaleidoscope-ParseTreeVisitor
33
---
44

55
# Kaleidoscope Parse Tree Visitors
6-
The Ubiquity.NET.Llvm Kaleidoscope tutorials all use ANTLR4 to parse the Kaleidoscope language When ANTLR processes the
7-
language grammar description to generate the lexer and parser it also generates a base "visitor" class for applying
8-
the [Visitor pattern](https://en.wikipedia.org/wiki/Visitor_pattern) to the parse tree. This is the primary mechanism
9-
for generating the [AST](xref:Kaleidoscope-AST) for these examples. The AST transformation classes derive from the ANTLR
10-
generated base visitor class.
6+
The Ubiquity.NET.Llvm Kaleidoscope tutorials all use ANTLR4 to parse the Kaleidoscope
7+
language When ANTLR processes the grammar description to generate the lexer and parser it
8+
also generates a base "visitor" class for applying the [Visitor pattern](https://en.wikipedia.org/wiki/Visitor_pattern)
9+
to the parse tree. This is the primary mechanism for generating the [AST](xref:Kaleidoscope-AST)
10+
for these examples. The AST transformation classes derive from the ANTLR generated base
11+
visitor class.
1112

12-
There are only a few top level rules in the grammar to consider (although each has many sub rules).
13+
There are only a few top level rules in the grammar to consider (although each has many
14+
sub-rules).
1315

1416
[!code-antlr[repl](Kaleidoscope.g4?start=181&end=187)]
1517

16-
The parse tree consist of a tree of nodes generated for each rule in the grammar. The rule classes are generated at
17-
build time when the antlr grammar file is parsed. The C# target for ANTLR4 will generate the rule classes with the
18-
partial keyword, allowing the application code to add application specific support to the rule classes, and thus to
19-
the parse tree. For Kaleidoscope, this is used to provide simpler access to the information parsed from the Kaleidoscope
20-
language input simplifying generation of the AST. For simplicity and clarity of understanding each of the extended partial
21-
classes are placed into their own source file.
18+
The parse tree consist of a tree of nodes generated for each rule in the grammar. The rule
19+
classes are generated at build time when the ANTLR grammar file is parsed. The C# target for
20+
ANTLR4 will generate the rule classes with the partial keyword, allowing the application
21+
code to add application specific support to the rule classes, and thus to the parse tree.
22+
For Kaleidoscope, this is used to provide simpler access to the information parsed from the
23+
Kaleidoscope language input simplifying generation of the AST. For simplicity and clarity of
24+
understanding each of the extended partial classes are placed into their own source file.
2225

23-
Generally speaking, the use of ANTLR and the ParseTree is a hidden internal implementation detail of the Ubiquity.NET.Llvm
24-
Kaleidoscope tutorials. The actual code generation deals only with the AST so the parsing could be done with some
25-
other technology. (Though with all the functionality that ANTLR4 provides it would take a strong argument to justify
26-
something else)
26+
Generally speaking, the use of ANTLR and the ParseTree is a hidden internal implementation
27+
detail of the Ubiquity.NET.Llvm Kaleidoscope tutorials. The actual code generation deals
28+
only with the AST so the parsing could be done with some other technology. (Though with all
29+
the functionality that ANTLR4 provides it would take a strong argument to justify something
30+
else)

src/Samples/Kaleidoscope/Kaleidoscope.Grammar/ANTLR/Kaleidoscope-Parsetree-examples.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ uid: Kaleidoscope-Parsetree-examples
1313
![Parse Tree](./parsetree-simpleexp-1.svg)
1414

1515
>[!NOTE]
16-
>The small circle in the upper left corner of the Expression nodes is the precedence value at
17-
>the entry to the rule. ANTLR uses a precedence climbing algorithm so this number indicates
18-
>the precedence for the expression in relation to others.
16+
>The small circle in the upper left corner of the Expression nodes is the precedence
17+
>value at the entry to the rule. ANTLR uses a precedence climbing algorithm so this number
18+
>indicates the precedence for the expression in relation to others.
1919
2020
>[!NOTE]
2121
>The parse tree for the expression has 5 children that are in evaluation order. That is,

0 commit comments

Comments
 (0)