How to Write a Compiler #7 - Top Level Statements
C-minor's top-level statements are implemented by manipulating the AST before invoking the other compilation stages and are easy introduction to working with the AST.
C-minor's top-level statements are implemented by manipulating the AST before invoking the other compilation stages and are easy introduction to working with the AST.
For language products typical unit testing doesn't work well long term. Instead I recommend sandboxing for early prototyping and a dedicated test case file runner for more end-to-end style testing.
If ever there was a design pattern that's perfectly suited to a job, it's the visitor pattern for working with an abstract syntax tree. But what is the visitor pattern and why is it so well suited?
The Parser takes a stream of tokens, checks the syntax is valid and produces an Abstract Syntax Tree.
Ask anyone who's worked on a compiler, and they'll all agree that the Abstract Syntax Tree is the most important structure in the whole compiler. But what exactly is it and what is it used for?
Tokenization is the process of reading source code and splitting it into meaningful symbols that describe the program's content. It's the first step of any compiler.
C-minor is a strongly typed, garbage collected language that compiles to in-memory machine code for direct execution. Here's how I built it.
Recently I purchased a Microsoft Surface Laptop 4 to replace my aging MacBook Pro. The Surface is a great machine: excellent keyboard and trackpad, beautiful display. It's slim, lightweight, powerful, just enough storage and has good battery life. But what a pity that all of that is ruined by one
Configuring the Windows boot manager so third-party boot loaders can directly load different versions of Windows.
nvpatch is a command line utility to patch Windows x64 applications to enable NVidia and AMD discreet graphics GPUs on low power devices.
An algorithm for converting boolean bit flag expressions to fast bit mask and test operations and even faster execution via dynamic IL method generation.
Explains how to run EA Origin games on Linux under Steam and Proton, using NFS The Run as an example.
This video finishes the implementation of Undo/Redo in the view as well as support for multiple views and plain text clipboard operations. For source code, see this tagged branch of the RichTextKit repo. Got questions or comments? Find me on Twitter - @toptensoftware
This video looks at the document side aspects of undo/redo support. For source code, see this tagged branch of the RichTextKit repo. Got questions or comments? Find me on Twitter - @toptensoftware
In this video we reach a bit of a milestone with basic edit operations now working! Got questions or comments? Find me on Twitter - @toptensoftware
Looks at enhancements to RichTextKit's TextBlock class to support primitive edit operations. For source code, see this tagged branch of the RichTextKit repo. Got questions or comments? Find me on Twitter - @toptensoftware
richedit
This video looks at the remaining mouse interactions for selecting whole words, lines and paragraphs.
richedit
Continuing the development of a rich text editor in C#, this time looking at scrolling.
richedit
Looks at the implementation of keyboard navigation in the text editor.
richedit
This video covers the "document" part of the document/view architecture that the editor will be based on and also sets up some basic caret to text interactions.
richedit
In this video I start on the development of the editor by implementing some basic caret and cursor functionality.
richedit
This is the first in a series of videos on building a rich text editor in C# and starts by covering the reason for wanting to build an editor and the toolkits and libraries upon which it will be based.
gaming
I'm not a hard-core gamer but I do enjoy a bit of casual gaming and since I spend all day at my desk the last thing I want to do is sit at the same desk to play games. So I built a lounge room gaming PC...
big80
Adds on-screen menus and FAT file system support for cassette images.
fpga
A simple on-chip logic analyzer written in VHDL, using NodeJS for data capture and GtkWave for analysis.
fpga
The Xilinx Spartan 6 is a popular FPGA used in many development boards like the Mimas V2, the Papilio Duo and many others. It's been around for about 10 years and Xilinx has committed to making the chip available for at least another 10 years. Unfortunately setting up a development
fpga
Experiments in using a serial UART port connection to reflect signal values between an FPGA and a connected PC.
trs80
Finishing touches for Big-80 including cassette recording, auto tape start/stop, amber and green screen mode and scan lines!
trs80
"Big-80" is an implementation of a TRS-80 Model 1 in an FPGA. This post describes the processor environment including the CPU itself, RAM, ROM and hooking it up to the video controller, keyboard and virtual cassette player to make a working TRS-80. TRS-80 Memory and Port Map The next step
fpga
Building a virtual TRS-80 cassette player that reads binary .cas files from an SD card and renders an audio stream representing a tape recording of that data.
fpga
Implementing the keyboard controller for a "Big-80" - a TRS-80 in an FPGA.
fpga
Implementing the video controller for a "Big-80" - a TRS-80 in an FPGA.