diff --git a/.notes/number-parsing.md b/.notes/number-parsing.md deleted file mode 100644 index c4fff43d..00000000 --- a/.notes/number-parsing.md +++ /dev/null @@ -1,39 +0,0 @@ -# Number Lexing Module Notes -## Table of Characters - -Table of the relevant characters, their representation in binary, and the values they should be converted to (both in decimal and binary): - -| Character | Binary | Result | -|:---------:|:-------:|:-------------:| -| 0 | 0110000 | 0₁₀ ≡ 00000₂ | -| 1 | 0110001 | 1₁₀ ≡ 00001₂ | -| 2 | 0110010 | 2₁₀ ≡ 00010₂ | -| 3 | 0110011 | 3₁₀ ≡ 00011₂ | -| 4 | 0110100 | 4₁₀ ≡ 00100₂ | -| 5 | 0110101 | 5₁₀ ≡ 00101₂ | -| 6 | 0110110 | 6₁₀ ≡ 00110₂ | -| 7 | 0110111 | 7₁₀ ≡ 00111₂ | -| 8 | 0111000 | 8₁₀ ≡ 01000₂ | -| 9 | 0111001 | 9₁₀ ≡ 01001₂ | -| a | 1100001 | 10₁₀ ≡ 01010₂ | -| b | 1100010 | 11₁₀ ≡ 01011₂ | -| c | 1100011 | 12₁₀ ≡ 01100₂ | -| d | 1100100 | 13₁₀ ≡ 01101₂ | -| e | 1100101 | 14₁₀ ≡ 01110₂ | -| f | 1100110 | 15₁₀ ≡ 01111₂ | -| A | 1000001 | 10₁₀ ≡ 01010₂ | -| B | 1000010 | 11₁₀ ≡ 01011₂ | -| C | 1000011 | 12₁₀ ≡ 01100₂ | -| D | 1000100 | 13₁₀ ≡ 01101₂ | -| E | 1000101 | 14₁₀ ≡ 01110₂ | -| F | 1000110 | 15₁₀ ≡ 01111₂ | - -## Conversion of characters to integers - -Looking at the above table, a pattern can be seen from the digits `0` to `9`: their 4 least significant bits are the value we want, therefore we just need to isolate them. - -The implementation uses a bitwise and (`&`) of the character and `1111₂`. - -Now, the upper and lower case letters from `a` to `f` only differ in their 6th least significant bit, and their 5 least significant bits already give us the 1st digit (although off by 1), so upper and lower case letters can be handled in indifferently by isolating the 5 least significant bits and adding `9₁₀` to the isolated bits. - -This is not being used because hexadecimal number parsing is left up to HexFloat from FParsec. diff --git a/Loretta.sln b/Loretta.sln index 9e0be9ac..ad130cf1 100644 --- a/Loretta.sln +++ b/Loretta.sln @@ -44,7 +44,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UI", "UI", "{B48CF6EF-B0EE-4E75-B482-962E0B94332F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Loretta.CodeAnalysis.Lua.StatisticsCollector", "src\Tools\Loretta.CodeAnalysis.Lua.StatisticsCollector\Loretta.CodeAnalysis.Lua.StatisticsCollector.csproj", "{1B47A562-62F8-4CC8-8F1F-E3BF0D32B32D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Loretta.CodeAnalysis.Lua.StatisticsCollector", "src\Tools\Loretta.CodeAnalysis.Lua.StatisticsCollector\Loretta.CodeAnalysis.Lua.StatisticsCollector.csproj", "{1B47A562-62F8-4CC8-8F1F-E3BF0D32B32D}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".notes", ".notes", "{60D59258-7EF1-46C7-973C-A65484BCC447}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -196,6 +198,7 @@ Global {F5174B96-5AC7-4508-8619-B8452ED0BAF5} = {87DABD33-4B9E-4E07-A20D-CB4DB6D049D2} {B48CF6EF-B0EE-4E75-B482-962E0B94332F} = {C487233C-597B-4FF3-8061-1B321E556E74} {1B47A562-62F8-4CC8-8F1F-E3BF0D32B32D} = {87DABD33-4B9E-4E07-A20D-CB4DB6D049D2} + {60D59258-7EF1-46C7-973C-A65484BCC447} = {8A9DF973-E520-48BC-95C0-23477FD4AFCC} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {44571FC4-549C-4D10-B763-5382A430C7AC}