mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-06 23:58:48 +00:00
[examples] fill in directory comments for all the latest examples
This commit is contained in:
@@ -11,9 +11,6 @@ bin/bld_core.sh show_ctx
|
|||||||
|
|
||||||
examps="examples"
|
examps="examples"
|
||||||
|
|
||||||
bin/bld_core.sh unit memory_management $examps/integration/memory_management.c
|
|
||||||
bin/bld_core.sh unit multi_threaded $examps/integration/multi_threaded.c
|
|
||||||
|
|
||||||
bin/bld_core.sh unit hello_world $examps/intro/hello_world.c
|
bin/bld_core.sh unit hello_world $examps/intro/hello_world.c
|
||||||
bin/bld_core.sh unit parse_check $examps/intro/parse_check.c
|
bin/bld_core.sh unit parse_check $examps/intro/parse_check.c
|
||||||
bin/bld_core.sh unit data_desk_like $examps/intro/data_desk_like_template.c
|
bin/bld_core.sh unit data_desk_like $examps/intro/data_desk_like_template.c
|
||||||
@@ -29,6 +26,9 @@ bin/bld_core.sh unit expr_c_like $examps/expr/expr_c_like.c
|
|||||||
|
|
||||||
bin/bld_core.sh unit overrides $examps/integration/overrides.c
|
bin/bld_core.sh unit overrides $examps/integration/overrides.c
|
||||||
|
|
||||||
|
bin/bld_core.sh unit multi_threaded $examps/integration/multi_threaded.c
|
||||||
|
bin/bld_core.sh unit memory_management $examps/integration/memory_management.c
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
||||||
###### Restore Path ###########################################################
|
###### Restore Path ###########################################################
|
||||||
|
|||||||
@@ -53,8 +53,27 @@ EXAMPLES:
|
|||||||
Commentary in this example focuses on strategies for setting up an effective
|
Commentary in this example focuses on strategies for setting up an effective
|
||||||
metaprogram.
|
metaprogram.
|
||||||
|
|
||||||
7. TODO
|
|
||||||
8. TODO
|
7. "expressions intro" expr/expr_intro.c, expr/expr_intro.mdesk
|
||||||
|
This example introduces the expression parsing feature built into Metadesk.
|
||||||
|
With it, flat sequences of Metadesk nodes can be parsed as arithmetic
|
||||||
|
expressions.
|
||||||
|
|
||||||
|
This example shows how to setup an operator table, call the expression parser
|
||||||
|
and interpret the expression tree that comes back. It discusses some of the
|
||||||
|
capabilities and limits of the expression system.
|
||||||
|
|
||||||
|
|
||||||
|
8. "c like expressions" expr/expr_c_like.c, expr/expr_c_like.mdesk
|
||||||
|
This example has a pre-built operator table setup for parsing C like
|
||||||
|
expressions. This can be used as an advanced example of the expression parser
|
||||||
|
or as a copy-paste template for making an expression parser that matches C.
|
||||||
|
The only C operator that is not supported in some way is the ternary operator.
|
||||||
|
|
||||||
|
The metadesk file for this example shows how to deal with a few quirks that
|
||||||
|
arise from the fact that the expression system is layered on top of the
|
||||||
|
Metadesk grammar.
|
||||||
|
|
||||||
|
|
||||||
9. "overrides" integration/overrides.c
|
9. "overrides" integration/overrides.c
|
||||||
When including the Metadesk library into an existing codebase, the overrides
|
When including the Metadesk library into an existing codebase, the overrides
|
||||||
@@ -63,7 +82,21 @@ EXAMPLES:
|
|||||||
you want to make your program CRT-free, or direct metadesk allocations to your
|
you want to make your program CRT-free, or direct metadesk allocations to your
|
||||||
own custom allocator.
|
own custom allocator.
|
||||||
|
|
||||||
10. TODO
|
|
||||||
11. TODO
|
10. "memory management" integration/memory_management.c
|
||||||
|
This example shows how to use Metadesk in situations where the basic
|
||||||
|
allocate-and-never-free strategy isn't good enough. The example discusses the
|
||||||
|
MD_Arena, shows the basics on getting started with it, and has a lot of tips
|
||||||
|
on further ways to use the arenas.
|
||||||
|
|
||||||
|
|
||||||
|
11. "multi threaded parse" integration/multi_threaded.c
|
||||||
|
If Metadesk is used to encode metadata in something like an asset pipeline
|
||||||
|
it may become useful to parse multiple Metadesk files in parallel. The library
|
||||||
|
doesn't have any thread safety "built in" to the APIs, but it is designed
|
||||||
|
to make it fairly straight forward to manage the thread safety yourself, and
|
||||||
|
this example shows how.
|
||||||
|
|
||||||
|
This example relies on some of the information explained in the memory
|
||||||
|
management example, so it may be useful to start there.
|
||||||
|
|
||||||
|
|||||||
+10
-2
@@ -8,12 +8,20 @@ Example Programs:
|
|||||||
[x] Commentary
|
[x] Commentary
|
||||||
[x] Example Type File With Errors
|
[x] Example Type File With Errors
|
||||||
[ ] Example of simple expression parser
|
[ ] Example of simple expression parser
|
||||||
[ ] Example of C-like expression parser (with value and type expressions)
|
|
||||||
[ ] Example(s) of using overrides
|
|
||||||
[x] Write
|
[x] Write
|
||||||
[ ] Commentary
|
[ ] Commentary
|
||||||
|
[ ] Example of C-like expression parser (with value and type expressions)
|
||||||
|
[x] Write
|
||||||
|
[ ] Commentary
|
||||||
|
[ ] Example(s) of using overrides
|
||||||
|
[x] Write
|
||||||
|
[x] Commentary
|
||||||
[ ] Example memory clearing in long-running program
|
[ ] Example memory clearing in long-running program
|
||||||
|
[x] Write
|
||||||
|
[ ] Commentary
|
||||||
[ ] Example multi-threaded parsing
|
[ ] Example multi-threaded parsing
|
||||||
|
[x] Write
|
||||||
|
[ ] Commentary
|
||||||
|
|
||||||
Example Metadesk Files:
|
Example Metadesk Files:
|
||||||
[x] Hello world
|
[x] Hello world
|
||||||
|
|||||||
Reference in New Issue
Block a user