1
0
mirror of https://github.com/fadden/6502bench.git synced 2026-04-25 21:18:25 +00:00

Label rework, part 1

This adds the concept of label annotations.  The primary driver of
the feature is the desire to note that sometimes you know what a
thing is, but sometimes you're just taking an educated guess.
Instead of writing "high_score_maybe", you can now write "high_score?",
which is more compact and consistent.  The annotations are stripped
off when generating source code, making them similar to Notes.

I also created a "Generated" annotation for the labels that are
synthesized by the address table formatter, but don't modify the
label for them, because there's not much need to remind the user
that "T1234" was generated by algorithm.

This also lays some of the groundwork for non-unique labels.
This commit is contained in:
Andy McFadden
2019-11-08 20:44:45 -08:00
parent b4519b2aa2
commit 4d079c8d14
26 changed files with 469 additions and 238 deletions
+8
View File
@@ -22,6 +22,14 @@ namespace SourceGen {
/// Given a list of LocalVariableTables, this determines the mapping of values to symbols
/// at a specific offset.
/// </summary>
/// <remarks>
/// We guarantee that the label will be unique within its scope. This happens at two
/// different levels:
/// (1) If the local variable label is present in the main symbol table, we use the
/// "de-duplication" table to remap it. We try not to let this happen, but it can.
/// (2) If the assembler doesn't define a way to re-use variable names, we make them
/// globally unique. [currently unused]
/// </remarks>
public class LocalVariableLookup {
/// <summary>
/// List of tables. The table's file offset is used as the key.