In this tutorial we're going to build a set of parser combinators.
We'll answer the above question in 2 steps.
- What is a parser?
- and, what is a parser combinator?
So first question: What is parser?
| @tool | |
| extends EditorScenePostImport | |
| class MeshInstanceList: | |
| var mesh: Mesh | |
| var aabb: AABB | |
| var transforms: Array | |
| # Converts geometry node instances into MultiMeshInstances | |
| func gn_instances_to_mm(parent: Node, scene: Node): |
| [gd_resource type="Theme" load_steps=12 format=3 uid="uid://7bvxnk5n5imx"] | |
| [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6h42l"] | |
| content_margin_left = 10.5 | |
| content_margin_top = 8.75 | |
| content_margin_right = 10.5 | |
| content_margin_bottom = 8.75 | |
| bg_color = Color(0.117647, 0.117647, 0.117647, 1) | |
| draw_center = false | |
| border_color = Color(1, 1, 1, 0.137255) |
For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.
After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft
| const assert = require('assert'); | |
| function calcBorderLen(edgeLen) { | |
| if (edgeLen <= 1) { | |
| return edgeLen; | |
| } | |
| return (4 * edgeLen) - 4; | |
| } | |
| function slice(edgeLen, pos) { |