Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
d05fc05
Update Trash tools, add new templates for antlr-ng tool parser genera…
kaby76 Jan 13, 2025
9e02a65
Updates for antlr-ng.
kaby76 Jan 14, 2025
626f29a
Update templates, tester, and version of Trash toolkit.
kaby76 Jan 16, 2025
3b1a348
Add debugging info.
kaby76 Jan 16, 2025
f5dada0
More debugging info.
kaby76 Jan 16, 2025
8d52e86
Forgot to add test for "*" as that is now a legal "target", meaning a…
kaby76 Jan 16, 2025
672e977
Typo in check.
kaby76 Jan 16, 2025
c18170d
Fix more typos.
kaby76 Jan 16, 2025
fb478e1
Add in generators testing.
kaby76 Jan 17, 2025
6bf1bee
Add debugging.
kaby76 Jan 17, 2025
9306194
Make sure to download jar for compile and run even though it is not u…
kaby76 Jan 17, 2025
77d711f
Update "*" recognition.
kaby76 Jan 17, 2025
31bfc96
Fix a couple of typos.
kaby76 Jan 17, 2025
0ee3c8b
Add in "npm init -y" for non-node projects.
kaby76 Jan 17, 2025
2309d12
Change "trxml2 .\Other.csproj" to "trxml2 Other.csproj" to workaround…
kaby76 Jan 17, 2025
4247a1f
Fix Cpp build, but Go and Dart messed up.
kaby76 Jan 17, 2025
004024a
Require "--version" for antlr-ng call.
kaby76 Jan 17, 2025
724a7a6
Updates to fix Cpp build.
kaby76 Jan 17, 2025
34bfe92
Fix "rm -rf" for Powershell. Fix location of antlr-ng.
kaby76 Jan 17, 2025
16d081d
Update Go target template and Trash for Go.
kaby76 Jan 19, 2025
bb61770
Merge branch 'antlr:master' into update-trash-antlr-ng
kaby76 Jan 29, 2025
cc1d70d
Updates to build antlr-ng in global directory. Prob won't work.
kaby76 Jan 29, 2025
73e6da3
Fix up global directory with temp variable.
kaby76 Jan 29, 2025
e52ca35
Fix typo in shell syntax.
kaby76 Jan 29, 2025
a3bd83c
Export environmental variables, try to find something that will work.
kaby76 Jan 29, 2025
70c2c9b
Replace with $HOME and see if that works. Prob not.
kaby76 Jan 29, 2025
2e16b0a
Fix Go target.
kaby76 Jan 29, 2025
dacf1ae
Fix Go templates.
kaby76 Jan 29, 2025
ca3c090
Fix ambiguity of grammar choice.
kaby76 Feb 1, 2025
17f79b5
Merge remote-tracking branch 'upstream/master' into update-trash-antl…
kaby76 Feb 11, 2025
3a53f23
Fix additional ambiguities of which grammar to test.
kaby76 Feb 11, 2025
283b8d4
Merge remote-tracking branch 'origin/remove-grammar-choice-ambiguity'…
kaby76 Feb 11, 2025
efb29d3
Update Cpp target templates, tester script, Trash toolkit version, an…
kaby76 Feb 11, 2025
bf9bb9c
Fix regression in Go target testing.
kaby76 Feb 11, 2025
3a2f230
Undo files that should not have been committed.
kaby76 Feb 11, 2025
53b2373
Change shells and see if this fixex Cpp/Windows target--and not break…
kaby76 Feb 11, 2025
4adbf81
Add debugging output.
kaby76 Feb 11, 2025
8fed54e
Add more debugging output.
kaby76 Feb 11, 2025
a87472e
Add even more debugging.
kaby76 Feb 11, 2025
1184f4c
Add in command line def of HOME from env as cmake does not work.
kaby76 Feb 11, 2025
878aa8e
Add in debugging info for what the tsx command really is.
kaby76 Feb 11, 2025
72d05ae
Update HOME var ref for anything other than Windows.
kaby76 Feb 12, 2025
fa3d68a
Remove "official" from testing to avoid problems. Remove unnecessary …
kaby76 Feb 12, 2025
8fe2e77
Add antlr4 call back in, with explanation, and better positioned to w…
kaby76 Feb 12, 2025
3193a83
Fix typo.
kaby76 Feb 12, 2025
ebb889f
Clean up.
kaby76 Feb 12, 2025
fdb0f82
Fix error in generating list of grammars to test.
kaby76 Feb 12, 2025
ad0d84c
Force cancel/rebuild.
kaby76 Feb 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 27 additions & 27 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,189 +3,189 @@
"isRoot": true,
"tools": {
"trcaret": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trcaret"
],
"rollForward": false
},
"trcover": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trcover"
],
"rollForward": false
},
"trgen": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trgen"
],
"rollForward": false
},
"trglob": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trglob"
],
"rollForward": false
},
"triconv": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"triconv"
],
"rollForward": false
},
"trparse": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trparse"
],
"rollForward": false
},
"trquery": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trquery"
],
"rollForward": false
},
"trtext": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trtext"
],
"rollForward": false
},
"trwdog": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trwdog"
],
"rollForward": false
},
"trxgrep": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trxgrep"
],
"rollForward": false
},
"trxml": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trxml"
],
"rollForward": false
},
"trxml2": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trxml2"
],
"rollForward": false
},
"trclonereplace": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trclonereplace"
],
"rollForward": false
},
"trcombine": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trcombine"
],
"rollForward": false
},
"trconvert": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trconvert"
],
"rollForward": false
},
"trfoldlit": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trfoldlit"
],
"rollForward": false
},
"trgenvsc": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trgenvsc"
],
"rollForward": false
},
"tritext": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"tritext"
],
"rollForward": false
},
"trjson": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trjson"
],
"rollForward": false
},
"trperf": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trperf"
],
"rollForward": false
},
"trrename": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trrename"
],
"rollForward": false
},
"trsort": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trsort"
],
"rollForward": false
},
"trsplit": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trsplit"
],
"rollForward": false
},
"trsponge": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trsponge"
],
"rollForward": false
},
"trtokens": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trtokens"
],
"rollForward": false
},
"trtree": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trtree"
],
"rollForward": false
},
"trunfold": {
"version": "0.23.11",
"version": "0.23.14",
"commands": [
"trunfold"
],
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ jobs:
arch
uname -a
if [ -f /proc/cpuinfo ]; then cat /proc/cpuinfo; fi
export
- name: Checkout
uses: actions/checkout@v4
with:
Expand Down Expand Up @@ -149,6 +150,16 @@ jobs:
shell: bash
run: |
dotnet trgen --help
- name: Install Antlr-ng
shell: pwsh
run: |
cd $HOME
git clone https://github.com/mike-lischke/antlr-ng.git
cd antlr-ng
echo HOME $HOME
git checkout c1ac333a9c544da98b3adbdd76310351f81bcfaa
npm i
npm run build
- name: Test
shell: pwsh
run: |
Expand Down
108 changes: 108 additions & 0 deletions _scripts/templates/Antlr4cs/st.CaseChangingCharStream.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
// Generated from trgen <version>

/* Copyright (c) 2012-2017 The ANTLR Project. All rights reserved.
* Use of this file is governed by the BSD 3-clause license that
* can be found in the LICENSE.txt file in the project root.
*/
using System;
using Antlr4.Runtime.Misc;

namespace Antlr4.Runtime
{
/// \<summary>
/// This class supports case-insensitive lexing by wrapping an existing
/// \<see cref=""ICharStream""/> and forcing the lexer to see either upper or
/// lowercase characters. Grammar literals should then be either upper or
/// lower case such as 'BEGIN' or 'begin'. The text of the character
/// stream is unaffected. Example: input 'BeGiN' would match lexer rule
/// 'BEGIN' if constructor parameter upper=true but getText() would return
/// 'BeGiN'.
/// \</summary>
public class CaseChangingCharStream : ICharStream
{
private ICharStream stream;
private bool upper;

/// \<summary>
/// Constructs a new CaseChangingCharStream wrapping the given \<paramref name=""stream""/> forcing
/// all characters to upper case or lower case.
/// \</summary>
/// \<param name=""stream"">The stream to wrap.\</param>
/// \<param name=""upper"">If true force each symbol to upper
/// case, otherwise force to lower.\</param>
public CaseChangingCharStream(ICharStream stream, bool upper)
{
this.stream = stream;
this.upper = upper;
}

public int Index
{
get
{
return stream.Index;
}
}

public int Size
{
get
{
return stream.Size;
}
}

public string SourceName
{
get
{
return stream.SourceName;
}
}

public void Consume()
{
stream.Consume();
}

[return: NotNull]
public string GetText(Interval interval)
{
return stream.GetText(interval);
}

public int La(int i)
{
int c = stream.La(i);

if (c \<= 0)
{
return c;
}

char o = (char)c;

if (upper)
{
return (int)char.ToUpperInvariant(o);
}

return (int)char.ToLowerInvariant(o);
}

public int Mark()
{
return stream.Mark();
}

public void Release(int marker)
{
stream.Release(marker);
}

public void Seek(int index)
{
stream.Seek(index);
}
}
}
39 changes: 39 additions & 0 deletions _scripts/templates/Antlr4cs/st.ErrorListener.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Generated from trgen <version>

using Antlr4.Runtime;
using Antlr4.Runtime.Misc;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

<if(has_name_space)>namespace <name_space>
{<endif>
public class ErrorListener\<S> : IAntlrErrorListener\<S>
{
public bool had_error;
bool _quiet;
bool _tee;
TextWriter _out;

public ErrorListener(bool quiet, bool tee, TextWriter @out)
{
_quiet = quiet;
_tee = tee;
_out = @out;
}

public virtual void SyntaxError(IRecognizer recognizer, S offendingSymbol, int line, int col, string msg, RecognitionException e)
{
had_error = true;
if (_tee)
{
_out.WriteLine("line " + line + ":" + col + " " + msg);
}
if (!_quiet)
{
System.Console.Error.WriteLine("line " + line + ":" + col + " " + msg);
}
}
}
<if(has_name_space)>}<endif>
Loading
Loading