-
Notifications
You must be signed in to change notification settings - Fork 502
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Internal] Parser: Adds Antlr Dependancy (#1691)
* turned back on parser * adding ANTLR files * got it to build * revert csproj * revert * revert * added Component Detection * adding notice file * added component name * updated cs proj Co-authored-by: Samer Boshra <[email protected]>
- Loading branch information
Showing
195 changed files
with
33,430 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
$a = Get-Content $args[0] | ||
$b = "// This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis." | ||
$c = "// <auto-generated/>" | ||
$d = "" | ||
Set-Content $args[0] -value $b, $c, $d, $a |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
// This file isn't generated, but this comment is necessary to exclude it from StyleCop analysis. | ||
// <auto-generated/> | ||
|
||
/* 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. | ||
*/ | ||
|
||
#if !PORTABLE | ||
|
||
using Antlr4.Runtime.Sharpen; | ||
using Encoding = System.Text.Encoding; | ||
using File = System.IO.File; | ||
|
||
namespace Antlr4.Runtime | ||
{ | ||
#if COMPACT | ||
using StreamReader = System.IO.StreamReader; | ||
#endif | ||
|
||
/// <summary> | ||
/// This is an | ||
/// <see cref="AntlrInputStream"/> | ||
/// that is loaded from a file all at once | ||
/// when you construct the object. | ||
/// </summary> | ||
internal class AntlrFileStream : AntlrInputStream | ||
{ | ||
protected internal string fileName; | ||
|
||
/// <exception cref="System.IO.IOException"/> | ||
public AntlrFileStream(string fileName) | ||
: this(fileName, null) | ||
{ | ||
} | ||
|
||
/// <exception cref="System.IO.IOException"/> | ||
public AntlrFileStream(string fileName, Encoding encoding) | ||
{ | ||
this.fileName = fileName; | ||
Load(fileName, encoding); | ||
} | ||
|
||
/// <exception cref="System.IO.IOException"/> | ||
public virtual void Load(string fileName, Encoding encoding) | ||
{ | ||
if (fileName == null) | ||
{ | ||
return; | ||
} | ||
|
||
string text; | ||
#if !COMPACT | ||
if (encoding != null) | ||
text = File.ReadAllText(fileName, encoding); | ||
else | ||
text = File.ReadAllText(fileName); | ||
#else | ||
if (encoding != null) | ||
text = ReadAllText(fileName, encoding); | ||
else | ||
text = ReadAllText(fileName); | ||
#endif | ||
|
||
data = text.ToCharArray(); | ||
n = data.Length; | ||
} | ||
|
||
public override string SourceName | ||
{ | ||
get | ||
{ | ||
return fileName; | ||
} | ||
} | ||
|
||
#if COMPACT | ||
private static string ReadAllText(string path) | ||
{ | ||
using (var reader = new StreamReader(path)) | ||
{ | ||
return reader.ReadToEnd(); | ||
} | ||
} | ||
|
||
private static string ReadAllText(string path, Encoding encoding) | ||
{ | ||
using (var reader = new StreamReader(path, encoding ?? Encoding.Default)) | ||
{ | ||
return reader.ReadToEnd(); | ||
} | ||
} | ||
#endif | ||
} | ||
} | ||
|
||
#endif |
Oops, something went wrong.