From 58e628bab9c0773fa7333c3f1b16c7dfbad2aaae Mon Sep 17 00:00:00 2001
From: Emmanouil Dermitzakis
Date: Mon, 19 Feb 2024 21:04:38 +0200
Subject: [PATCH 01/13] feat: initial CSharp interpreter
---
CSharp/.gitignore | 424 ++-
CSharp/CSharp.csproj | 22 +
CSharp/CSharp.sln | 16 +
CSharp/Interpreter/ArcscriptExpression.cs | 345 +++
CSharp/Interpreter/ArcscriptFunctions.cs | 183 ++
CSharp/Interpreter/ArcscriptOutputs.cs | 148 +
CSharp/Interpreter/ArcscriptParserBase.cs | 135 +
CSharp/Interpreter/ArcscriptState.cs | 47 +
CSharp/Interpreter/ArcscriptTranspiler.cs | 71 +
CSharp/Interpreter/ArcscriptVisitor.cs | 461 +++
.../Interpreter/Generated/ArcscriptLexer.cs | 363 +++
.../Interpreter/Generated/ArcscriptParser.cs | 2634 +++++++++++++++++
.../Generated/ArcscriptParserBaseVisitor.cs | 419 +++
.../Generated/ArcscriptParserVisitor.cs | 264 ++
CSharp/Interpreter/Generated/AssemblyInfo.cs | 3 +
CSharp/Interpreter/INodes/IAttribute.cs | 29 +
CSharp/Interpreter/INodes/IBoard.cs | 6 +
CSharp/Interpreter/INodes/IComponent.cs | 6 +
CSharp/Interpreter/INodes/IConnection.cs | 20 +
CSharp/Interpreter/INodes/IElement.cs | 24 +
CSharp/Interpreter/INodes/IHasAttributes.cs | 19 +
CSharp/Interpreter/INodes/IHelperClasses.cs | 37 +
CSharp/Interpreter/INodes/INode.cs | 10 +
CSharp/Interpreter/INodes/IProject.cs | 20 +
CSharp/Interpreter/INodes/IVariable.cs | 23 +
CSharp/Interpreter/Nodes.cs | 31 +
CSharp/Interpreter/Utils.cs | 27 +
CSharp/Project/Attribute.cs | 11 +
CSharp/Project/Component.cs | 10 +
CSharp/Project/Connection.cs | 27 +
CSharp/Project/Element.cs | 32 +
CSharp/Project/HelperClasses.cs | 23 +
CSharp/Project/Project.cs | 26 +
CSharp/Project/Variable.cs | 22 +
CSharp/TestObjects.cs | 25 +
CSharp/UnitTests.cs | 134 +
CSharp/__tests__/conditions.json | 100 +
CSharp/__tests__/parseErrors.json | 96 +
CSharp/__tests__/replaceVariables.json | 62 +
CSharp/__tests__/runtimeErrors.json | 60 +
CSharp/__tests__/valid.json | 446 +++
41 files changed, 6860 insertions(+), 1 deletion(-)
create mode 100644 CSharp/CSharp.csproj
create mode 100644 CSharp/CSharp.sln
create mode 100644 CSharp/Interpreter/ArcscriptExpression.cs
create mode 100644 CSharp/Interpreter/ArcscriptFunctions.cs
create mode 100644 CSharp/Interpreter/ArcscriptOutputs.cs
create mode 100644 CSharp/Interpreter/ArcscriptParserBase.cs
create mode 100644 CSharp/Interpreter/ArcscriptState.cs
create mode 100644 CSharp/Interpreter/ArcscriptTranspiler.cs
create mode 100644 CSharp/Interpreter/ArcscriptVisitor.cs
create mode 100644 CSharp/Interpreter/Generated/ArcscriptLexer.cs
create mode 100644 CSharp/Interpreter/Generated/ArcscriptParser.cs
create mode 100644 CSharp/Interpreter/Generated/ArcscriptParserBaseVisitor.cs
create mode 100644 CSharp/Interpreter/Generated/ArcscriptParserVisitor.cs
create mode 100644 CSharp/Interpreter/Generated/AssemblyInfo.cs
create mode 100644 CSharp/Interpreter/INodes/IAttribute.cs
create mode 100644 CSharp/Interpreter/INodes/IBoard.cs
create mode 100644 CSharp/Interpreter/INodes/IComponent.cs
create mode 100644 CSharp/Interpreter/INodes/IConnection.cs
create mode 100644 CSharp/Interpreter/INodes/IElement.cs
create mode 100644 CSharp/Interpreter/INodes/IHasAttributes.cs
create mode 100644 CSharp/Interpreter/INodes/IHelperClasses.cs
create mode 100644 CSharp/Interpreter/INodes/INode.cs
create mode 100644 CSharp/Interpreter/INodes/IProject.cs
create mode 100644 CSharp/Interpreter/INodes/IVariable.cs
create mode 100644 CSharp/Interpreter/Nodes.cs
create mode 100644 CSharp/Interpreter/Utils.cs
create mode 100644 CSharp/Project/Attribute.cs
create mode 100644 CSharp/Project/Component.cs
create mode 100644 CSharp/Project/Connection.cs
create mode 100644 CSharp/Project/Element.cs
create mode 100644 CSharp/Project/HelperClasses.cs
create mode 100644 CSharp/Project/Project.cs
create mode 100644 CSharp/Project/Variable.cs
create mode 100644 CSharp/TestObjects.cs
create mode 100644 CSharp/UnitTests.cs
create mode 100644 CSharp/__tests__/conditions.json
create mode 100644 CSharp/__tests__/parseErrors.json
create mode 100644 CSharp/__tests__/replaceVariables.json
create mode 100644 CSharp/__tests__/runtimeErrors.json
create mode 100644 CSharp/__tests__/valid.json
diff --git a/CSharp/.gitignore b/CSharp/.gitignore
index 21bc544..893d366 100644
--- a/CSharp/.gitignore
+++ b/CSharp/.gitignore
@@ -1 +1,423 @@
-src/Generated
\ No newline at end of file
+src/Generated
+
+## Ignore Visual Studio temporary files, build results, and
+## files generated by popular Visual Studio add-ons.
+##
+## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
+
+# User-specific files
+*.rsuser
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+
+# User-specific files (MonoDevelop/Xamarin Studio)
+*.userprefs
+
+# Mono auto generated files
+mono_crash.*
+
+# Build results
+[Dd]ebug/
+[Dd]ebugPublic/
+[Rr]elease/
+[Rr]eleases/
+x64/
+x86/
+[Aa][Rr][Mm]/
+[Aa][Rr][Mm]64/
+bld/
+[Bb]in/
+[Oo]bj/
+[Ll]og/
+
+# Visual Studio 2015/2017 cache/options directory
+.vs/
+# Uncomment if you have tasks that create the project's static files in wwwroot
+#wwwroot/
+
+# Visual Studio 2017 auto generated files
+Generated\ Files/
+
+# MSTest test Results
+[Tt]est[Rr]esult*/
+[Bb]uild[Ll]og.*
+
+# NUNIT
+*.VisualState.xml
+TestResult.xml
+
+# Build Results of an ATL Project
+[Dd]ebugPS/
+[Rr]eleasePS/
+dlldata.c
+
+# Benchmark Results
+BenchmarkDotNet.Artifacts/
+
+# .NET Core
+project.lock.json
+project.fragment.lock.json
+artifacts/
+
+# StyleCop
+StyleCopReport.xml
+
+# Files built by Visual Studio
+*_i.c
+*_p.c
+*_h.h
+*.ilk
+*.meta
+*.obj
+*.iobj
+*.pch
+*.pdb
+*.ipdb
+*.pgc
+*.pgd
+*.rsp
+*.sbr
+*.tlb
+*.tli
+*.tlh
+*.tmp
+*.tmp_proj
+*_wpftmp.csproj
+*.log
+*.vspscc
+*.vssscc
+.builds
+*.pidb
+*.svclog
+*.scc
+
+# Chutzpah Test files
+_Chutzpah*
+
+# Visual C++ cache files
+ipch/
+*.aps
+*.ncb
+*.opendb
+*.opensdf
+*.sdf
+*.cachefile
+*.VC.db
+*.VC.VC.opendb
+
+# Visual Studio profiler
+*.psess
+*.vsp
+*.vspx
+*.sap
+
+# Visual Studio Trace Files
+*.e2e
+
+# TFS 2012 Local Workspace
+$tf/
+
+# Guidance Automation Toolkit
+*.gpState
+
+# ReSharper is a .NET coding add-in
+_ReSharper*/
+*.[Rr]e[Ss]harper
+*.DotSettings.user
+
+# JustCode is a .NET coding add-in
+.JustCode
+
+# TeamCity is a build add-in
+_TeamCity*
+
+# DotCover is a Code Coverage Tool
+*.dotCover
+
+# AxoCover is a Code Coverage Tool
+.axoCover/*
+!.axoCover/settings.json
+
+# Visual Studio code coverage results
+*.coverage
+*.coveragexml
+
+# NCrunch
+_NCrunch_*
+.*crunch*.local.xml
+nCrunchTemp_*
+
+# MightyMoose
+*.mm.*
+AutoTest.Net/
+
+# Web workbench (sass)
+.sass-cache/
+
+# Installshield output folder
+[Ee]xpress/
+
+# DocProject is a documentation generator add-in
+DocProject/buildhelp/
+DocProject/Help/*.HxT
+DocProject/Help/*.HxC
+DocProject/Help/*.hhc
+DocProject/Help/*.hhk
+DocProject/Help/*.hhp
+DocProject/Help/Html2
+DocProject/Help/html
+
+# Click-Once directory
+publish/
+
+# Publish Web Output
+*.[Pp]ublish.xml
+*.azurePubxml
+# Note: Comment the next line if you want to checkin your web deploy settings,
+# but database connection strings (with potential passwords) will be unencrypted
+*.pubxml
+*.publishproj
+
+# Microsoft Azure Web App publish settings. Comment the next line if you want to
+# checkin your Azure Web App publish settings, but sensitive information contained
+# in these scripts will be unencrypted
+PublishScripts/
+
+# NuGet Packages
+*.nupkg
+# The packages folder can be ignored because of Package Restore
+**/[Pp]ackages/*
+# except build/, which is used as an MSBuild target.
+!**/[Pp]ackages/build/
+# Uncomment if necessary however generally it will be regenerated when needed
+#!**/[Pp]ackages/repositories.config
+# NuGet v3's project.json files produces more ignorable files
+*.nuget.props
+*.nuget.targets
+
+# Microsoft Azure Build Output
+csx/
+*.build.csdef
+
+# Microsoft Azure Emulator
+ecf/
+rcf/
+
+# Windows Store app package directories and files
+AppPackages/
+BundleArtifacts/
+Package.StoreAssociation.xml
+_pkginfo.txt
+*.appx
+*.appxbundle
+*.appxupload
+
+# Visual Studio cache files
+# files ending in .cache can be ignored
+*.[Cc]ache
+# but keep track of directories ending in .cache
+!?*.[Cc]ache/
+
+# Others
+ClientBin/
+~$*
+*~
+*.dbmdl
+*.dbproj.schemaview
+*.jfm
+*.pfx
+*.publishsettings
+orleans.codegen.cs
+
+# Including strong name files can present a security risk
+# (https://github.com/github/gitignore/pull/2483#issue-259490424)
+#*.snk
+
+# Since there are multiple workflows, uncomment next line to ignore bower_components
+# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
+#bower_components/
+
+# RIA/Silverlight projects
+Generated_Code/
+
+# Backup & report files from converting an old project file
+# to a newer Visual Studio version. Backup files are not needed,
+# because we have git ;-)
+_UpgradeReport_Files/
+Backup*/
+UpgradeLog*.XML
+UpgradeLog*.htm
+ServiceFabricBackup/
+*.rptproj.bak
+
+# SQL Server files
+*.mdf
+*.ldf
+*.ndf
+
+# Business Intelligence projects
+*.rdl.data
+*.bim.layout
+*.bim_*.settings
+*.rptproj.rsuser
+*- Backup*.rdl
+
+# Microsoft Fakes
+FakesAssemblies/
+
+# GhostDoc plugin setting file
+*.GhostDoc.xml
+
+# Node.js Tools for Visual Studio
+.ntvs_analysis.dat
+node_modules/
+
+# Visual Studio 6 build log
+*.plg
+
+# Visual Studio 6 workspace options file
+*.opt
+
+# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
+*.vbw
+
+# Visual Studio LightSwitch build output
+**/*.HTMLClient/GeneratedArtifacts
+**/*.DesktopClient/GeneratedArtifacts
+**/*.DesktopClient/ModelManifest.xml
+**/*.Server/GeneratedArtifacts
+**/*.Server/ModelManifest.xml
+_Pvt_Extensions
+
+# Paket dependency manager
+.paket/paket.exe
+paket-files/
+
+# FAKE - F# Make
+.fake/
+
+# CodeRush personal settings
+.cr/personal
+
+# Python Tools for Visual Studio (PTVS)
+__pycache__/
+*.pyc
+
+# Cake - Uncomment if you are using it
+# tools/**
+# !tools/packages.config
+
+# Tabs Studio
+*.tss
+
+# Telerik's JustMock configuration file
+*.jmconfig
+
+# BizTalk build output
+*.btp.cs
+*.btm.cs
+*.odx.cs
+*.xsd.cs
+
+# OpenCover UI analysis results
+OpenCover/
+
+# Azure Stream Analytics local run output
+ASALocalRun/
+
+# MSBuild Binary and Structured Log
+*.binlog
+
+# NVidia Nsight GPU debugger configuration file
+*.nvuser
+
+# MFractors (Xamarin productivity tool) working folder
+.mfractor/
+
+# Local History for Visual Studio
+.localhistory/
+
+# BeatPulse healthcheck temp database
+healthchecksdb
+
+# Backup folder for Package Reference Convert tool in Visual Studio 2017
+MigrationBackup/
+
+
+
+## VS CODE
+.vscode/*
+!.vscode/settings.json
+!.vscode/tasks.json
+!.vscode/launch.json
+!.vscode/extensions.json
+
+
+# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm
+# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
+
+# User-specific stuff
+.idea/**/workspace.xml
+.idea/**/tasks.xml
+.idea/**/usage.statistics.xml
+.idea/**/dictionaries
+.idea/**/shelf
+
+# Generated files
+.idea/**/contentModel.xml
+
+# Sensitive or high-churn files
+.idea/**/dataSources/
+.idea/**/dataSources.ids
+.idea/**/dataSources.local.xml
+.idea/**/sqlDataSources.xml
+.idea/**/dynamic.xml
+.idea/**/uiDesigner.xml
+.idea/**/dbnavigator.xml
+
+# Gradle
+.idea/**/gradle.xml
+.idea/**/libraries
+
+# Gradle and Maven with auto-import
+# When using Gradle or Maven with auto-import, you should exclude module files,
+# since they will be recreated, and may cause churn. Uncomment if using
+# auto-import.
+# .idea/modules.xml
+# .idea/*.iml
+# .idea/modules
+
+# CMake
+cmake-build-*/
+
+# Mongo Explorer plugin
+.idea/**/mongoSettings.xml
+
+# File-based project format
+*.iws
+
+# IntelliJ
+out/
+
+# mpeltonen/sbt-idea plugin
+.idea_modules/
+
+# JIRA plugin
+atlassian-ide-plugin.xml
+
+# Cursive Clojure plugin
+.idea/replstate.xml
+
+# Crashlytics plugin (for Android Studio and IntelliJ)
+com_crashlytics_export_strings.xml
+crashlytics.properties
+crashlytics-build.properties
+fabric.properties
+
+# Editor-based Rest Client
+.idea/httpRequests
+
+# Android studio 3.1+ serialized cache file
+.idea/caches/build_file_checksums.ser
\ No newline at end of file
diff --git a/CSharp/CSharp.csproj b/CSharp/CSharp.csproj
new file mode 100644
index 0000000..d74dd02
--- /dev/null
+++ b/CSharp/CSharp.csproj
@@ -0,0 +1,22 @@
+
+
+
+ net6.0
+ enable
+ enable
+
+ false
+ true
+ Arcweave
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CSharp/CSharp.sln b/CSharp/CSharp.sln
new file mode 100644
index 0000000..c54d833
--- /dev/null
+++ b/CSharp/CSharp.sln
@@ -0,0 +1,16 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSharp", "CSharp.csproj", "{46E8C9BE-D0EC-440D-9FBB-034D1FD4E434}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {46E8C9BE-D0EC-440D-9FBB-034D1FD4E434}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {46E8C9BE-D0EC-440D-9FBB-034D1FD4E434}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {46E8C9BE-D0EC-440D-9FBB-034D1FD4E434}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {46E8C9BE-D0EC-440D-9FBB-034D1FD4E434}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+EndGlobal
diff --git a/CSharp/Interpreter/ArcscriptExpression.cs b/CSharp/Interpreter/ArcscriptExpression.cs
new file mode 100644
index 0000000..b56042c
--- /dev/null
+++ b/CSharp/Interpreter/ArcscriptExpression.cs
@@ -0,0 +1,345 @@
+
+using System;
+using System.Collections;
+
+namespace Arcweave.Interpreter
+{
+ public class Expression : IComparable
+ {
+ public object Value { get; set; }
+ public Expression() { Value = null; }
+ public Expression(object value) { Value = value; }
+ public Expression(object value, Type type) { Value = Convert.ChangeType(value, type); }
+ public Expression(Expression expression) { Value = expression.Value; }
+ public void SetValue(object value) { Value = value; }
+ public Type Type() { return Value.GetType(); }
+ public static Expression operator +(Expression e) { return e; }
+ public static Expression operator -(Expression e)
+ {
+ if (e.Value is int i)
+ {
+ return new Expression(-i);
+ }
+ else if (e.Value is double value)
+ {
+ return new Expression(-value);
+ }
+ return e;
+ }
+ public static Expression operator +(Expression first, Expression second)
+ {
+ if (first.Type() == typeof(string) || second.Type() == typeof(string))
+ {
+ return new Expression(first.Value.ToString() + second.Value.ToString());
+ }
+ var doubleValues = GetDoubleValues(first.Value, second.Value);
+ if (!doubleValues.HasDouble)
+ {
+ var intValue = (int)(doubleValues.Value1 + doubleValues.Value2);
+ return new Expression(intValue);
+ }
+ else
+ {
+ return new Expression(doubleValues.Value1 + doubleValues.Value2);
+ }
+ }
+
+ public static Expression operator -(Expression first, Expression second)
+ {
+ var doubleValues = GetDoubleValues(first.Value, second.Value);
+ if (!doubleValues.HasDouble)
+ {
+ var intValue = (int) (doubleValues.Value1 - doubleValues.Value2);
+ return new Expression(intValue);
+ } else
+ {
+ return new Expression(doubleValues.Value1 - doubleValues.Value2);
+ }
+ }
+
+ public static Expression operator *(Expression first, Expression second)
+ {
+ var doubleValues = GetDoubleValues(first.Value, second.Value);
+ if (!doubleValues.HasDouble)
+ {
+ var intValue = (int)(doubleValues.Value1 * doubleValues.Value2);
+ return new Expression(intValue);
+ }
+ else
+ {
+ return new Expression(doubleValues.Value1 * doubleValues.Value2);
+ }
+ }
+
+ public static Expression operator /(Expression first, Expression second)
+ {
+ var doubleValues = GetDoubleValues(first.Value, second.Value);
+ return new Expression(doubleValues.Value1 / doubleValues.Value2);
+ }
+
+ public static bool operator ==(Expression first, Expression second)
+ {
+ System.Type type1 = first.Type();
+ if (type1 == typeof(int) || type1 == typeof(double))
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second.Value);
+ return doubleValues.Value1 == doubleValues.Value2;
+ }
+ if (type1 == typeof(bool))
+ {
+ return (bool)first.Value == (bool)second.Value;
+ }
+ if (type1 == typeof(string))
+ {
+ return (string)first.Value == (string)second.Value;
+ }
+ return false;
+ }
+
+ public int CompareTo(object? other)
+ {
+ Expression o = (Expression)other;
+ DoubleValues fValues = GetDoubleValues(this.Value, o.Value);
+ double result = fValues.Value1 - fValues.Value2;
+ if (result < 0)
+ {
+ return -1;
+ } else if (result > 0)
+ {
+ return 1;
+ }
+ return 0;
+ }
+
+ public override bool Equals(object obj)
+ {
+ if (obj == null || !(obj is Expression))
+ {
+ return false;
+ }
+ Expression e = (Expression)obj;
+
+ System.Type type1 = Type();
+ if (type1 == typeof(int) || type1 == typeof(double))
+ {
+ DoubleValues doubleValues = GetDoubleValues(Value, e.Value);
+ return doubleValues.Value1 == doubleValues.Value2;
+ }
+ if (type1 == typeof(bool))
+ {
+ return (bool)Value == (bool)e.Value;
+ }
+ if (type1 == typeof(string))
+ {
+ return (string)Value == (string)e.Value;
+ }
+ return false;
+ }
+
+ public static bool operator !=(Expression first, Expression second)
+ {
+ System.Type type1 = first.Type();
+ if (type1 == typeof(int) || type1 == typeof(double))
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second.Value);
+ return doubleValues.Value1 != doubleValues.Value2;
+ }
+ if (type1 == typeof(bool))
+ {
+ return (bool)first.Value != (bool)second.Value;
+ }
+ if (type1 == typeof(string))
+ {
+ return (string)first.Value != (string)second.Value;
+ }
+ return true;
+ }
+ public static bool operator ==(Expression first, bool second)
+ {
+ return GetBoolValue(first.Value) == second;
+ }
+ public static bool operator !=(Expression first, bool second)
+ {
+ return GetBoolValue(first.Value) != second;
+ }
+ public static bool operator ==(Expression first, int second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 == doubleValues.Value2;
+ }
+ public static bool operator !=(Expression first, int second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 != doubleValues.Value2;
+ }
+ public static bool operator ==(Expression first, double second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 == doubleValues.Value2;
+ }
+ public static bool operator !=(Expression first, double second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 != doubleValues.Value2;
+ }
+ public static bool operator ==(Expression first, string second)
+ {
+ return (string)first.Value == second;
+ }
+
+ public override int GetHashCode()
+ {
+ return Value.GetHashCode();
+ }
+ public static bool operator !=(Expression first, string second)
+ {
+ return (string)first.Value == second;
+ }
+
+ public static bool operator >(Expression first, Expression second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second.Value);
+ return doubleValues.Value1 > doubleValues.Value2;
+ }
+ public static bool operator <(Expression first, Expression second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second.Value);
+ return doubleValues.Value1 < doubleValues.Value2;
+ }
+ public static bool operator >=(Expression first, Expression second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second.Value);
+ return doubleValues.Value1 >= doubleValues.Value2;
+ }
+ public static bool operator <=(Expression first, Expression second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second.Value);
+ return doubleValues.Value1 <= doubleValues.Value2;
+ }
+ public static bool operator >(Expression first, int second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 > doubleValues.Value2;
+ }
+ public static bool operator <(Expression first, int second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 < doubleValues.Value2;
+ }
+ public static bool operator >=(Expression first, int second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 >= doubleValues.Value2;
+ }
+ public static bool operator <=(Expression first, int second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 <= doubleValues.Value2;
+ }
+ public static bool operator >(Expression first, double second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 > doubleValues.Value2;
+ }
+ public static bool operator <(Expression first, double second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 < doubleValues.Value2;
+ }
+ public static bool operator >=(Expression first, double second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 >= doubleValues.Value2;
+ }
+ public static bool operator <=(Expression first, double second)
+ {
+ DoubleValues doubleValues = GetDoubleValues(first.Value, second);
+ return doubleValues.Value1 <= doubleValues.Value2;
+ }
+ public static Expression operator !(Expression e)
+ {
+ return new Expression(!GetBoolValue(e.Value));
+ }
+ public static bool operator true(Expression e)
+ {
+ return GetBoolValue(e.Value);
+ }
+ public static bool operator false(Expression e)
+ {
+ return !GetBoolValue(e.Value);
+ }
+ public static Expression operator &(Expression first, Expression second)
+ {
+ if (GetBoolValue(first.Value) && GetBoolValue(second.Value))
+ {
+ return new Expression(true);
+ }
+ return new Expression(false);
+ }
+
+ public static Expression operator |(Expression first, Expression second)
+ {
+ if (GetBoolValue(first.Value) || GetBoolValue(second.Value))
+ {
+ return new Expression(true);
+ }
+ return new Expression(false);
+ }
+
+ public override string ToString()
+ {
+ return Value.ToString();
+ }
+
+ private struct DoubleValues
+ {
+ public double Value1;
+ public double Value2;
+ public bool HasDouble;
+
+ public DoubleValues(double val1, double val2, bool hasDouble) { Value1 = val1; Value2 = val2; HasDouble = hasDouble; }
+ }
+
+ private static DoubleValues GetDoubleValues(object first, object second) {
+ bool hasDouble = false;
+ int value1, value2;
+ double flValue1 = 0, flValue2 = 0;
+ if (first.GetType() == typeof(int))
+ {
+ value1 = (int)first;
+ flValue1 = value1;
+ } else if (first.GetType() == typeof(double))
+ {
+ hasDouble = true;
+ flValue1 = (double)first;
+ } else if (first.GetType() == typeof(bool))
+ {
+ flValue1 = (bool)first ? 1 : 0;
+ }
+
+ if (second.GetType() == typeof(int))
+ {
+ value2 = (int)second;
+ flValue2 = value2;
+ } else if (second.GetType() == typeof(double))
+ {
+ hasDouble = true;
+ flValue2 = (double)second;
+ } else if (second.GetType() == typeof(bool))
+ {
+ flValue2 = (bool)second ? 1 : 0;
+ }
+
+ return new DoubleValues(flValue1, flValue2, hasDouble);
+ }
+
+ internal static bool GetBoolValue(object value)
+ {
+ if (value.GetType() == typeof(bool)) { return (bool)value; }
+ if (value.GetType() == typeof(string)) { return ((string)value).Length > 0; }
+ if (value.GetType() == typeof(int)) { return (int)value > 0; }
+ if (value.GetType() == typeof(double)) { return (double)value > 0; }
+ return false;
+ }
+ }
+}
\ No newline at end of file
diff --git a/CSharp/Interpreter/ArcscriptFunctions.cs b/CSharp/Interpreter/ArcscriptFunctions.cs
new file mode 100644
index 0000000..284c9c0
--- /dev/null
+++ b/CSharp/Interpreter/ArcscriptFunctions.cs
@@ -0,0 +1,183 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Arcweave.Interpreter.INodes;
+
+namespace Arcweave.Interpreter
+{
+ public class Functions
+ {
+ private static readonly Random _getrandom = new Random();
+ private IProject _project;
+ private string elementId;
+ private ArcscriptState state;
+ public Dictionary, object>> functions { get; private set; } = new Dictionary, object>>();
+
+ public Dictionary returnTypes = new Dictionary()
+ {
+ { "sqrt", typeof (double) },
+ { "sqr", typeof (double) },
+ { "abs", typeof (double) },
+ { "random", typeof (double) },
+ { "roll", typeof (int) },
+ { "show", typeof (string) },
+ { "reset", typeof (void) },
+ { "resetAll", typeof (void) },
+ { "round", typeof (int) },
+ { "min", typeof (double) },
+ { "max", typeof (double) },
+ { "visits", typeof (int) }
+ };
+
+ public Functions(string elementId, IProject project, ArcscriptState state) {
+ this._project = project;
+ this.elementId = elementId;
+ this.state = state;
+
+ this.functions["sqrt"] = this.Sqrt;
+ this.functions["sqr"] = this.Sqr;
+ this.functions["abs"] = this.Abs;
+ this.functions["random"] = this.Random;
+ this.functions["roll"] = this.Roll;
+ this.functions["show"] = this.Show;
+ this.functions["reset"] = this.Reset;
+ this.functions["resetAll"] = this.ResetAll;
+ this.functions["round"] = this.Round;
+ this.functions["min"] = this.Min;
+ this.functions["max"] = this.Max;
+ this.functions["visits"] = this.Visits;
+ }
+
+ public object Sqrt(IList
".Length);
+ this.state.Outputs.AddParagraph(paragraphContent);
+ return context.GetText();
+ }
+
+ public override object VisitBlockquote(ArcscriptParser.BlockquoteContext context)
+ {
+ this.state.Outputs.AddBlockquote();
+ this.VisitChildren(context);
+ this.state.Outputs.ExitBlockquote();
+ return context.GetText();
+ }
+
+ public override object VisitAssignment_segment([NotNull] ArcscriptParser.Assignment_segmentContext context) {
+ this.state.Outputs.AddScriptOutput(null);
+ return this.VisitStatement_assignment(context.statement_assignment());
+ }
+
+ public override object VisitFunction_call_segment([NotNull] ArcscriptParser.Function_call_segmentContext context) {
+ this.state.Outputs.AddScriptOutput(null);
+ return this.VisitStatement_function_call(context.statement_function_call());
+ }
+
+ public override object VisitConditional_section([NotNull] ArcscriptParser.Conditional_sectionContext context) {
+ this.state.Outputs.AddScriptOutput(null);
+ ConditionalSection if_section = (ConditionalSection)this.VisitIf_section(context.if_section());
+ if ( if_section.Clause ) {
+ this.state.Outputs.AddScriptOutput(null);
+ return if_section.Script;
+ }
+ foreach(ArcscriptParser.Else_if_sectionContext else_if_context in context.else_if_section())
+ {
+ ConditionalSection elif_section = (ConditionalSection)this.VisitElse_if_section(else_if_context);
+ if (elif_section.Clause )
+ {
+ return elif_section.Script;
+ }
+ }
+
+ if ( context.else_section() != null ) {
+ ConditionalSection elseSection = (ConditionalSection)this.VisitElse_section(context.else_section());
+ this.state.Outputs.AddScriptOutput(null);
+ return elseSection.Script;
+ }
+ this.state.Outputs.AddScriptOutput(null);
+ return null;
+ }
+
+ public override object VisitIf_section([NotNull] ArcscriptParser.If_sectionContext context) {
+ Expression result = (Expression)this.VisitIf_clause(context.if_clause());
+ ConditionalSection ifSection = new ConditionalSection(false, null);
+ if ( result ) {
+ ifSection.Clause = true;
+ ifSection.Script = this.VisitScript(context.script());
+ }
+ return ifSection;
+ }
+
+ public override object VisitElse_if_section([NotNull] ArcscriptParser.Else_if_sectionContext context) {
+ Expression result = (Expression)this.VisitElse_if_clause(context.else_if_clause());
+ ConditionalSection elseIfSection = new ConditionalSection(false, null);
+ if ( result ) {
+ elseIfSection.Clause = true;
+ elseIfSection.Script = this.VisitScript(context.script());
+ }
+ return elseIfSection;
+ }
+
+ public override object VisitElse_section([NotNull] ArcscriptParser.Else_sectionContext context) {
+ return new ConditionalSection(true, this.VisitScript(context.script()));
+ }
+
+ public override object VisitIf_clause([NotNull] ArcscriptParser.If_clauseContext context) {
+ return this.VisitCompound_condition_or(context.compound_condition_or());
+ }
+
+ public override object VisitElse_if_clause([NotNull] ArcscriptParser.Else_if_clauseContext context) {
+ return this.VisitCompound_condition_or(context.compound_condition_or());
+ }
+
+ public override object VisitStatement_assignment([NotNull] ArcscriptParser.Statement_assignmentContext context) {
+ string variableName = context.VARIABLE().GetText();
+ IVariable variable = this.state.GetVariable(variableName);
+
+ Expression compound_condition_or = (Expression)this.VisitCompound_condition_or(context.compound_condition_or());
+ if ( context.ASSIGN() != null ) {
+ this.state.SetVarValue(variableName, compound_condition_or.Value);
+ return null;
+ }
+
+ Expression variableValue = new Expression(this.state.GetVarValue(variableName));
+
+ if ( context.ASSIGNADD() != null ) {
+ variableValue += compound_condition_or;
+ } else if ( context.ASSIGNSUB() != null ) {
+ variableValue -= compound_condition_or;
+ } else if ( context.ASSIGNMUL() != null ) {
+ variableValue *= compound_condition_or;
+ } else if ( context.ASSIGNDIV() != null ) {
+ variableValue /= compound_condition_or;
+ }
+
+ this.state.SetVarValue(variableName, variableValue.Value);
+ return null;
+ }
+
+ public override object VisitCompound_condition_or([NotNull] ArcscriptParser.Compound_condition_orContext context) {
+ Expression compound_condition_and = (Expression)this.VisitCompound_condition_and(context.compound_condition_and());
+ if ( context.compound_condition_or() != null ) {
+ Expression compound_condition_or = (Expression)this.VisitCompound_condition_or(context.compound_condition_or());
+ Expression result = compound_condition_and || compound_condition_or;
+ return result;
+ }
+ return compound_condition_and;
+ }
+
+ public override object VisitCompound_condition_and([NotNull] ArcscriptParser.Compound_condition_andContext context) {
+ Expression negated_unary_condition = (Expression)this.VisitNegated_unary_condition(context.negated_unary_condition());
+ if ( context.compound_condition_and() != null ) {
+ Expression compound_condition_and = (Expression)this.VisitCompound_condition_and(context.compound_condition_and());
+ Expression result = negated_unary_condition && compound_condition_and;
+ return result;
+ }
+
+ return negated_unary_condition;
+ }
+
+ public override object VisitNegated_unary_condition([NotNull] ArcscriptParser.Negated_unary_conditionContext context) {
+ Expression unary_condition = (Expression)this.VisitUnary_condition(context.unary_condition());
+
+ if ( context.NEG() != null || context.NOTKEYWORD() != null ) {
+ return !unary_condition;
+ }
+
+ return unary_condition;
+ }
+
+ public override object VisitUnary_condition([NotNull] ArcscriptParser.Unary_conditionContext context) {
+ return this.VisitCondition(context.condition());
+ }
+
+ public override object VisitCondition([NotNull] ArcscriptParser.ConditionContext context) {
+ if ( context.expression().Length == 1 ) {
+ return this.VisitExpression(context.expression()[0]);
+ }
+ ArcscriptParser.Conditional_operatorContext conditional_operator_context = context.conditional_operator();
+ Expression exp0 = (Expression)this.VisitExpression(context.expression()[0]);
+ Expression exp1 = (Expression)this.VisitExpression(context.expression()[1]);
+
+ bool result = false;
+ if ( conditional_operator_context.GT() != null ) {
+ result = exp0 > exp1;
+
+ }
+ if ( conditional_operator_context.GE() != null ) {
+ result = exp0 >= exp1;
+ }
+ if ( conditional_operator_context.LT() != null ) {
+ result = exp0 < exp1;
+ }
+ if ( conditional_operator_context.LE() != null ) {
+ result = exp0 <= exp1;
+ }
+ if ( conditional_operator_context.EQ() != null ) {
+ result = exp0 == exp1;
+ }
+ if ( conditional_operator_context.NE() != null ) {
+ result = exp0 != exp1;
+ }
+ if ( conditional_operator_context.ISKEYWORD() != null ) {
+ if ( conditional_operator_context.NOTKEYWORD() != null ) {
+ result = exp0 != exp1;
+ } else
+ {
+ result = exp0 == exp1;
+ }
+ }
+
+ return new Expression(result);
+ }
+
+ public override object VisitExpression([NotNull] ArcscriptParser.ExpressionContext context) {
+ if ( context.STRING() != null ) {
+ string result = context.STRING().GetText();
+ result = result.Substring(1, result.Length - 2);
+ return new Expression(result);
+ }
+ if ( context.BOOLEAN() != null ) {
+ return new Expression(context.BOOLEAN().GetText() == "true");
+ }
+ return this.VisitAdditive_numeric_expression(context.additive_numeric_expression());
+ }
+
+ public override object VisitAdditive_numeric_expression([NotNull] ArcscriptParser.Additive_numeric_expressionContext context) {
+ Expression mult_num_expression = (Expression)this.VisitMultiplicative_numeric_expression(context.multiplicative_numeric_expression());
+
+ if ( context.additive_numeric_expression() != null ) {
+ Expression result = (Expression)this.VisitAdditive_numeric_expression(context.additive_numeric_expression());
+ if ( context.ADD() != null ) {
+ return mult_num_expression + result;
+ }
+ // Else MINUS
+ return mult_num_expression - result;
+ }
+
+ return mult_num_expression;
+ }
+
+ public override object VisitMultiplicative_numeric_expression([NotNull] ArcscriptParser.Multiplicative_numeric_expressionContext context) {
+ Expression signed_unary_num_expr = (Expression)this.VisitSigned_unary_numeric_expression(context.signed_unary_numeric_expression());
+
+ if ( context.multiplicative_numeric_expression() != null ) {
+ Expression result = (Expression)this.VisitMultiplicative_numeric_expression(context.multiplicative_numeric_expression());
+ if ( context.MUL() != null ) {
+ return signed_unary_num_expr * result;
+ }
+ // Else DIV
+ return signed_unary_num_expr / result;
+ }
+
+ return signed_unary_num_expr;
+ }
+
+ public override object VisitSigned_unary_numeric_expression([NotNull] ArcscriptParser.Signed_unary_numeric_expressionContext context) {
+ Expression unary_num_expr = (Expression)this.VisitUnary_numeric_expression(context.unary_numeric_expression());
+ ArcscriptParser.SignContext sign = context.sign();
+
+ if ( sign != null ) {
+ if ( sign.ADD() != null ) {
+ return unary_num_expr;
+ }
+ // Else MINUS
+ return -unary_num_expr;
+ }
+ return unary_num_expr;
+ }
+
+ public override object VisitUnary_numeric_expression([NotNull] ArcscriptParser.Unary_numeric_expressionContext context) {
+ if ( context.FLOAT() != null ) {
+ return new Expression(double.Parse(context.FLOAT().GetText()));
+ }
+ if ( context.INTEGER() != null ) {
+ return new Expression(int.Parse(context.INTEGER().GetText()));
+ }
+ if ( context.VARIABLE() != null ) {
+ string variableName = context.VARIABLE().GetText();
+ return new Expression(this.state.GetVarValue(variableName));
+ }
+
+ if ( context.function_call() != null )
+ {
+ object functionResult = this.VisitFunction_call(context.function_call());
+ if (functionResult.GetType() == typeof(Expression))
+ {
+ return functionResult;
+ }
+ return new Expression(functionResult);
+ }
+ return this.VisitCompound_condition_or(context.compound_condition_or());
+ }
+ public override object VisitVoid_function_call([NotNull] ArcscriptParser.Void_function_callContext context)
+ {
+ string fname = "";
+ IList argument_list_result = null;
+ if (context.VFNAME() != null)
+ {
+ fname = context.VFNAME().GetText();
+ if (context.argument_list() != null)
+ {
+ argument_list_result = (IList)this.VisitArgument_list(context.argument_list());
+ }
+ }
+ if (context.VFNAMEVARS() != null)
+ {
+ fname = context.VFNAMEVARS().GetText();
+ if (context.variable_list() != null)
+ {
+ argument_list_result = (IList)this.VisitVariable_list(context.variable_list());
+ }
+ }
+
+ object returnValue = this._functions.functions[fname](argument_list_result);
+
+ return returnValue;
+ }
+
+ public override object VisitFunction_call([NotNull] ArcscriptParser.Function_callContext context) {
+ IList argument_list_result = null;
+ if ( context.argument_list() != null ) {
+ argument_list_result = (IList)this.VisitArgument_list(context.argument_list());
+ }
+
+ string fname = context.FNAME().GetText();
+
+ Type resultType = this._functions.returnTypes[fname];
+ object returnValue = this._functions.functions[fname](argument_list_result);
+
+ return returnValue;
+ }
+
+ public override object VisitVariable_list([NotNull] ArcscriptParser.Variable_listContext context)
+ {
+ List variables = new List();
+ foreach (ITerminalNode variable in context.VARIABLE())
+ {
+ IVariable varObject = this.state.GetVariable(variable.GetText());
+ variables.Add(varObject);
+ }
+ return variables;
+ }
+
+ public override object VisitArgument_list([NotNull] ArcscriptParser.Argument_listContext context) {
+ List argumentList = new List();
+ foreach ( ArcscriptParser.ArgumentContext argument in context.argument() ) {
+ argumentList.Add(this.VisitArgument(argument));
+ }
+ return argumentList;
+ }
+
+ public override object VisitArgument([NotNull] ArcscriptParser.ArgumentContext context) {
+ if ( context.STRING() != null ) {
+ string result = context.STRING().GetText();
+ result = result.Substring(1, result.Length - 2);
+ return new Expression(result);
+ }
+ if ( context.mention() != null ) {
+ Mention mention_result = (Mention)this.VisitMention(context.mention());
+ return mention_result;
+ }
+ return this.VisitAdditive_numeric_expression(context.additive_numeric_expression());
+ }
+
+ public override object VisitMention([NotNull] ArcscriptParser.MentionContext context) {
+ Dictionary attrs = new Dictionary();
+
+ foreach ( ArcscriptParser.Mention_attributesContext attr in context.mention_attributes() ) {
+ Dictionary res = (Dictionary)this.VisitMention_attributes(attr);
+ attrs.Add((string)res["name"], (string)res["value"]);
+ }
+ string label = "";
+ if ( context.MENTION_LABEL() != null ) {
+ label = context.MENTION_LABEL().GetText();
+ }
+ return new Mention(label, attrs);
+ }
+
+ public override object VisitMention_attributes([NotNull] ArcscriptParser.Mention_attributesContext context) {
+ string name = context.ATTR_NAME().GetText();
+ ITerminalNode ctxvalue = context.ATTR_VALUE();
+ object value = true;
+ if ( ctxvalue != null ) {
+ string strvalue = ctxvalue.GetText();
+ if ( ( strvalue.StartsWith('"') && strvalue.EndsWith('"') ) ||
+ ( strvalue.StartsWith("'") && strvalue.EndsWith("'") ) ) {
+ strvalue = strvalue.Substring(1, strvalue.Length - 2);
+ }
+ value = strvalue;
+ }
+ return new Dictionary { { "name", name }, { "value", value } };
+ }
+
+ public class Argument
+ {
+ public Type type { get; private set; }
+ public object value { get; private set; }
+ public Argument(Type type, object value) {
+ this.type = type;
+ this.value = value;
+ }
+ }
+
+ public class Mention
+ {
+ public string label { get; private set; }
+ public Dictionary attrs { get; private set; }
+
+ public Mention(string label, Dictionary attrs) {
+ this.label = label;
+ this.attrs = attrs;
+ }
+ }
+
+ public struct ConditionalSection
+ {
+ public bool Clause;
+ public object Script;
+
+ public ConditionalSection(bool clause, object script) { Clause = clause; Script = script; }
+ }
+ }
+}
\ No newline at end of file
diff --git a/CSharp/Interpreter/Generated/ArcscriptLexer.cs b/CSharp/Interpreter/Generated/ArcscriptLexer.cs
new file mode 100644
index 0000000..30146fc
--- /dev/null
+++ b/CSharp/Interpreter/Generated/ArcscriptLexer.cs
@@ -0,0 +1,363 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// ANTLR Version: 4.13.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from ArcscriptLexer.g4 by ANTLR 4.13.1
+
+// Unreachable code detected
+#pragma warning disable 0162
+// The variable '...' is assigned but its value is never used
+#pragma warning disable 0219
+// Missing XML comment for publicly visible type or member '...'
+#pragma warning disable 1591
+// Ambiguous reference in cref attribute
+#pragma warning disable 419
+
+namespace Arcweave.Interpreter {
+using System;
+using System.IO;
+using System.Text;
+using Antlr4.Runtime;
+using Antlr4.Runtime.Atn;
+using Antlr4.Runtime.Misc;
+using DFA = Antlr4.Runtime.Dfa.DFA;
+
+[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.1")]
+[System.CLSCompliant(false)]
+public partial class ArcscriptLexer : Lexer {
+ protected static DFA[] decisionToDFA;
+ protected static PredictionContextCache sharedContextCache = new PredictionContextCache();
+ public const int
+ CODESTART=1, PARAGRAPHSTART=2, BLOCKQUOTESTART=3, NORMAL_WHITESPACE=4,
+ PARAGRAPHEND=5, BQ_CODESTART=6, BQ_PARAGRAPHSTART=7, BLOCKQUOTEEND=8,
+ BQ_WHITESPACE=9, CODEEND=10, MENTION_TAG_OPEN=11, FLOAT=12, INTEGER=13,
+ DIGIT=14, LPAREN=15, RPAREN=16, ASSIGNMUL=17, ASSIGNDIV=18, ASSIGNADD=19,
+ ASSIGNSUB=20, MUL=21, DIV=22, ADD=23, SUB=24, GE=25, GT=26, LE=27, LT=28,
+ EQ=29, NE=30, AND=31, OR=32, ASSIGN=33, NEG=34, COMMA=35, LBRACE=36, RBRACE=37,
+ BOOLEAN=38, FNAME=39, VFNAME=40, VFNAMEVARS=41, IFKEYWORD=42, ELSEKEYWORD=43,
+ ELSEIFKEYWORD=44, ENDIFKEYWORD=45, ANDKEYWORD=46, ORKEYWORD=47, ISKEYWORD=48,
+ NOTKEYWORD=49, STRING=50, VARIABLE=51, WHITESPACE=52, TAG_CLOSE=53, ATTR_NAME=54,
+ TAG_EQUALS=55, MENTION_TAG_CLOSE=56, TAG_WHITESPACE=57, TAG_OPEN=58, MENTION_LABEL=59,
+ ATTR_VALUE=60, ATTRIBUTE=61;
+ public const int
+ PARAGRAPH=1, BLOCKQUOTE=2, CODESEGMENT=3, MENTIONSEGMENT=4, MENTIONLABELSEGMENT=5,
+ MENTION_ATTR_SEGMENT=6;
+ public static string[] channelNames = {
+ "DEFAULT_TOKEN_CHANNEL", "HIDDEN"
+ };
+
+ public static string[] modeNames = {
+ "DEFAULT_MODE", "PARAGRAPH", "BLOCKQUOTE", "CODESEGMENT", "MENTIONSEGMENT",
+ "MENTIONLABELSEGMENT", "MENTION_ATTR_SEGMENT"
+ };
+
+ public static readonly string[] ruleNames = {
+ "CODESTART", "PARAGRAPHSTART", "BLOCKQUOTESTART", "NORMAL_WHITESPACE",
+ "PARAGRAPHEND", "BQ_CODESTART", "BQ_PARAGRAPHSTART", "BLOCKQUOTEEND",
+ "BQ_WHITESPACE", "CODEEND", "MENTION_TAG_OPEN", "FLOAT", "INTEGER", "DIGIT",
+ "LPAREN", "RPAREN", "ASSIGNMUL", "ASSIGNDIV", "ASSIGNADD", "ASSIGNSUB",
+ "MUL", "DIV", "ADD", "SUB", "GE", "GT", "LE", "LT", "EQ", "NE", "AND",
+ "OR", "ASSIGN", "NEG", "COMMA", "LBRACE", "RBRACE", "BOOLEAN", "FNAME",
+ "VFNAME", "VFNAMEVARS", "IFKEYWORD", "ELSEKEYWORD", "ELSEIFKEYWORD", "ENDIFKEYWORD",
+ "ANDKEYWORD", "ORKEYWORD", "ISKEYWORD", "NOTKEYWORD", "STRING", "STRING_CONTENT",
+ "VARIABLE", "WHITESPACE", "TAG_CLOSE", "ATTR_NAME", "TAG_EQUALS", "MENTION_TAG_CLOSE",
+ "TAG_WHITESPACE", "TAG_OPEN", "MENTION_LABEL", "ATTR_VALUE", "ATTRIBUTE",
+ "ATTCHARS", "ATTCHAR", "HEXCHARS", "DECCHARS", "DOUBLE_QUOTE_STRING",
+ "SINGLE_QUOTE_STRING"
+ };
+
+
+ public ArcscriptLexer(ICharStream input)
+ : this(input, Console.Out, Console.Error) { }
+
+ public ArcscriptLexer(ICharStream input, TextWriter output, TextWriter errorOutput)
+ : base(input, output, errorOutput)
+ {
+ Interpreter = new LexerATNSimulator(this, _ATN, decisionToDFA, sharedContextCache);
+ }
+
+ private static readonly string[] _LiteralNames = {
+ null, null, null, null, null, null, null, null, "''", null,
+ "''", "''", null, null, "'/span>'",
+ null, "'<'"
+ };
+ private static readonly string[] _SymbolicNames = {
+ null, "CODESTART", "PARAGRAPHSTART", "BLOCKQUOTESTART", "NORMAL_WHITESPACE",
+ "PARAGRAPHEND", "BQ_CODESTART", "BQ_PARAGRAPHSTART", "BLOCKQUOTEEND",
+ "BQ_WHITESPACE", "CODEEND", "MENTION_TAG_OPEN", "FLOAT", "INTEGER", "DIGIT",
+ "LPAREN", "RPAREN", "ASSIGNMUL", "ASSIGNDIV", "ASSIGNADD", "ASSIGNSUB",
+ "MUL", "DIV", "ADD", "SUB", "GE", "GT", "LE", "LT", "EQ", "NE", "AND",
+ "OR", "ASSIGN", "NEG", "COMMA", "LBRACE", "RBRACE", "BOOLEAN", "FNAME",
+ "VFNAME", "VFNAMEVARS", "IFKEYWORD", "ELSEKEYWORD", "ELSEIFKEYWORD", "ENDIFKEYWORD",
+ "ANDKEYWORD", "ORKEYWORD", "ISKEYWORD", "NOTKEYWORD", "STRING", "VARIABLE",
+ "WHITESPACE", "TAG_CLOSE", "ATTR_NAME", "TAG_EQUALS", "MENTION_TAG_CLOSE",
+ "TAG_WHITESPACE", "TAG_OPEN", "MENTION_LABEL", "ATTR_VALUE", "ATTRIBUTE"
+ };
+ public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames);
+
+ [NotNull]
+ public override IVocabulary Vocabulary
+ {
+ get
+ {
+ return DefaultVocabulary;
+ }
+ }
+
+ public override string GrammarFileName { get { return "ArcscriptLexer.g4"; } }
+
+ public override string[] RuleNames { get { return ruleNames; } }
+
+ public override string[] ChannelNames { get { return channelNames; } }
+
+ public override string[] ModeNames { get { return modeNames; } }
+
+ public override int[] SerializedAtn { get { return _serializedATN; } }
+
+ static ArcscriptLexer() {
+ decisionToDFA = new DFA[_ATN.NumberOfDecisions];
+ for (int i = 0; i < _ATN.NumberOfDecisions; i++) {
+ decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i);
+ }
+ }
+ private static int[] _serializedATN = {
+ 4,0,61,659,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,6,-1,2,0,7,0,2,1,7,1,2,2,7,2,
+ 2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,
+ 7,11,2,12,7,12,2,13,7,13,2,14,7,14,2,15,7,15,2,16,7,16,2,17,7,17,2,18,
+ 7,18,2,19,7,19,2,20,7,20,2,21,7,21,2,22,7,22,2,23,7,23,2,24,7,24,2,25,
+ 7,25,2,26,7,26,2,27,7,27,2,28,7,28,2,29,7,29,2,30,7,30,2,31,7,31,2,32,
+ 7,32,2,33,7,33,2,34,7,34,2,35,7,35,2,36,7,36,2,37,7,37,2,38,7,38,2,39,
+ 7,39,2,40,7,40,2,41,7,41,2,42,7,42,2,43,7,43,2,44,7,44,2,45,7,45,2,46,
+ 7,46,2,47,7,47,2,48,7,48,2,49,7,49,2,50,7,50,2,51,7,51,2,52,7,52,2,53,
+ 7,53,2,54,7,54,2,55,7,55,2,56,7,56,2,57,7,57,2,58,7,58,2,59,7,59,2,60,
+ 7,60,2,61,7,61,2,62,7,62,2,63,7,63,2,64,7,64,2,65,7,65,2,66,7,66,2,67,
+ 7,67,1,0,1,0,1,0,1,0,1,0,1,0,5,0,150,8,0,10,0,12,0,153,9,0,1,0,1,0,1,0,
+ 1,0,1,0,1,0,1,0,1,0,5,0,163,8,0,10,0,12,0,166,9,0,1,0,1,0,1,0,1,0,1,1,
+ 1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,1,180,8,1,10,1,12,1,183,9,1,1,1,3,1,186,
+ 8,1,1,1,1,1,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,5,2,203,
+ 8,2,10,2,12,2,206,9,2,1,2,1,2,1,2,1,2,1,3,4,3,213,8,3,11,3,12,3,214,1,
+ 3,1,3,1,4,5,4,220,8,4,10,4,12,4,223,9,4,1,4,1,4,1,4,1,4,1,4,1,4,1,4,1,
+ 5,1,5,1,5,1,5,1,5,1,5,5,5,238,8,5,10,5,12,5,241,9,5,1,5,1,5,1,5,1,5,1,
+ 5,1,5,1,5,1,5,5,5,251,8,5,10,5,12,5,254,9,5,1,5,1,5,1,5,1,5,1,6,1,6,1,
+ 6,1,6,1,6,1,6,1,6,1,6,5,6,268,8,6,10,6,12,6,271,9,6,1,6,3,6,274,8,6,1,
+ 6,1,6,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,1,7,
+ 1,8,4,8,295,8,8,11,8,12,8,296,1,8,1,8,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,
+ 1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,9,1,10,1,10,1,10,1,10,1,10,1,10,1,10,1,10,
+ 1,11,5,11,326,8,11,10,11,12,11,329,9,11,1,11,1,11,4,11,333,8,11,11,11,
+ 12,11,334,1,12,4,12,338,8,12,11,12,12,12,339,1,13,1,13,1,14,1,14,1,15,
+ 1,15,1,16,1,16,1,16,1,17,1,17,1,17,1,18,1,18,1,18,1,19,1,19,1,19,1,20,
+ 1,20,1,21,1,21,1,22,1,22,1,23,1,23,1,24,1,24,1,24,1,25,1,25,1,25,1,25,
+ 1,25,3,25,376,8,25,1,26,1,26,1,26,1,27,1,27,1,27,1,27,1,27,3,27,386,8,
+ 27,1,28,1,28,1,28,1,29,1,29,1,29,1,30,1,30,1,30,1,30,1,30,1,30,1,30,1,
+ 30,1,30,1,30,1,30,1,30,3,30,406,8,30,1,31,1,31,1,31,1,32,1,32,1,33,1,33,
+ 1,34,1,34,1,35,1,35,1,36,1,36,1,37,1,37,1,37,1,37,1,37,1,37,1,37,1,37,
+ 1,37,3,37,430,8,37,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,
+ 38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,
+ 38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,1,38,3,38,469,
+ 8,38,1,39,1,39,1,39,1,39,1,39,1,40,1,40,1,40,1,40,1,40,1,40,1,40,1,40,
+ 1,40,1,40,1,40,1,40,1,40,3,40,489,8,40,1,41,1,41,1,41,1,42,1,42,1,42,1,
+ 42,1,42,1,43,1,43,1,43,1,43,1,43,1,43,1,43,1,44,1,44,1,44,1,44,1,44,1,
+ 44,1,45,1,45,1,45,1,45,1,46,1,46,1,46,1,47,1,47,1,47,1,48,1,48,1,48,1,
+ 48,1,49,1,49,5,49,528,8,49,10,49,12,49,531,9,49,1,49,1,49,1,49,5,49,536,
+ 8,49,10,49,12,49,539,9,49,1,49,3,49,542,8,49,1,50,1,50,1,50,3,50,547,8,
+ 50,1,51,1,51,5,51,551,8,51,10,51,12,51,554,9,51,1,52,4,52,557,8,52,11,
+ 52,12,52,558,1,52,1,52,1,53,1,53,1,53,1,53,1,54,1,54,5,54,569,8,54,10,
+ 54,12,54,572,9,54,1,55,1,55,1,55,1,55,1,56,1,56,1,56,1,56,1,56,1,56,1,
+ 56,1,56,1,56,1,57,1,57,1,57,1,57,1,58,1,58,1,58,1,58,1,59,4,59,596,8,59,
+ 11,59,12,59,597,1,60,5,60,601,8,60,10,60,12,60,604,9,60,1,60,1,60,1,60,
+ 1,60,1,61,1,61,1,61,1,61,1,61,3,61,615,8,61,1,62,4,62,618,8,62,11,62,12,
+ 62,619,1,62,3,62,623,8,62,1,63,3,63,626,8,63,1,64,1,64,4,64,630,8,64,11,
+ 64,12,64,631,1,65,4,65,635,8,65,11,65,12,65,636,1,65,3,65,640,8,65,1,66,
+ 1,66,5,66,644,8,66,10,66,12,66,647,9,66,1,66,1,66,1,67,1,67,5,67,653,8,
+ 67,10,67,12,67,656,9,67,1,67,1,67,1,221,0,68,7,1,9,2,11,3,13,4,15,5,17,
+ 6,19,7,21,8,23,9,25,10,27,11,29,12,31,13,33,14,35,15,37,16,39,17,41,18,
+ 43,19,45,20,47,21,49,22,51,23,53,24,55,25,57,26,59,27,61,28,63,29,65,30,
+ 67,31,69,32,71,33,73,34,75,35,77,36,79,37,81,38,83,39,85,40,87,41,89,42,
+ 91,43,93,44,95,45,97,46,99,47,101,48,103,49,105,50,107,0,109,51,111,52,
+ 113,53,115,54,117,55,119,56,121,57,123,58,125,59,127,60,129,61,131,0,133,
+ 0,135,0,137,0,139,0,141,0,7,0,1,2,3,4,5,6,14,1,0,62,62,3,0,9,10,13,13,
+ 32,32,1,0,48,57,5,0,10,10,13,13,34,34,39,39,92,92,9,0,34,34,39,39,92,92,
+ 97,98,102,102,110,110,114,114,116,116,118,118,4,0,36,36,65,90,95,95,97,
+ 122,5,0,36,36,48,57,65,90,95,95,97,122,3,0,58,58,65,90,97,122,5,0,45,46,
+ 48,58,65,90,95,95,97,122,1,0,60,60,7,0,35,35,43,59,61,61,63,63,65,90,95,
+ 95,97,122,3,0,48,57,65,70,97,102,2,0,34,34,60,60,2,0,39,39,60,60,693,0,
+ 7,1,0,0,0,0,9,1,0,0,0,0,11,1,0,0,0,0,13,1,0,0,0,1,15,1,0,0,0,2,17,1,0,
+ 0,0,2,19,1,0,0,0,2,21,1,0,0,0,2,23,1,0,0,0,3,25,1,0,0,0,3,27,1,0,0,0,3,
+ 29,1,0,0,0,3,31,1,0,0,0,3,33,1,0,0,0,3,35,1,0,0,0,3,37,1,0,0,0,3,39,1,
+ 0,0,0,3,41,1,0,0,0,3,43,1,0,0,0,3,45,1,0,0,0,3,47,1,0,0,0,3,49,1,0,0,0,
+ 3,51,1,0,0,0,3,53,1,0,0,0,3,55,1,0,0,0,3,57,1,0,0,0,3,59,1,0,0,0,3,61,
+ 1,0,0,0,3,63,1,0,0,0,3,65,1,0,0,0,3,67,1,0,0,0,3,69,1,0,0,0,3,71,1,0,0,
+ 0,3,73,1,0,0,0,3,75,1,0,0,0,3,77,1,0,0,0,3,79,1,0,0,0,3,81,1,0,0,0,3,83,
+ 1,0,0,0,3,85,1,0,0,0,3,87,1,0,0,0,3,89,1,0,0,0,3,91,1,0,0,0,3,93,1,0,0,
+ 0,3,95,1,0,0,0,3,97,1,0,0,0,3,99,1,0,0,0,3,101,1,0,0,0,3,103,1,0,0,0,3,
+ 105,1,0,0,0,3,109,1,0,0,0,3,111,1,0,0,0,4,113,1,0,0,0,4,115,1,0,0,0,4,
+ 117,1,0,0,0,4,119,1,0,0,0,4,121,1,0,0,0,5,123,1,0,0,0,5,125,1,0,0,0,6,
+ 127,1,0,0,0,6,129,1,0,0,0,7,143,1,0,0,0,9,185,1,0,0,0,11,189,1,0,0,0,13,
+ 212,1,0,0,0,15,221,1,0,0,0,17,231,1,0,0,0,19,273,1,0,0,0,21,277,1,0,0,
+ 0,23,294,1,0,0,0,25,300,1,0,0,0,27,316,1,0,0,0,29,327,1,0,0,0,31,337,1,
+ 0,0,0,33,341,1,0,0,0,35,343,1,0,0,0,37,345,1,0,0,0,39,347,1,0,0,0,41,350,
+ 1,0,0,0,43,353,1,0,0,0,45,356,1,0,0,0,47,359,1,0,0,0,49,361,1,0,0,0,51,
+ 363,1,0,0,0,53,365,1,0,0,0,55,367,1,0,0,0,57,375,1,0,0,0,59,377,1,0,0,
+ 0,61,385,1,0,0,0,63,387,1,0,0,0,65,390,1,0,0,0,67,405,1,0,0,0,69,407,1,
+ 0,0,0,71,410,1,0,0,0,73,412,1,0,0,0,75,414,1,0,0,0,77,416,1,0,0,0,79,418,
+ 1,0,0,0,81,429,1,0,0,0,83,468,1,0,0,0,85,470,1,0,0,0,87,488,1,0,0,0,89,
+ 490,1,0,0,0,91,493,1,0,0,0,93,498,1,0,0,0,95,505,1,0,0,0,97,511,1,0,0,
+ 0,99,515,1,0,0,0,101,518,1,0,0,0,103,521,1,0,0,0,105,541,1,0,0,0,107,546,
+ 1,0,0,0,109,548,1,0,0,0,111,556,1,0,0,0,113,562,1,0,0,0,115,566,1,0,0,
+ 0,117,573,1,0,0,0,119,577,1,0,0,0,121,586,1,0,0,0,123,590,1,0,0,0,125,
+ 595,1,0,0,0,127,602,1,0,0,0,129,614,1,0,0,0,131,617,1,0,0,0,133,625,1,
+ 0,0,0,135,627,1,0,0,0,137,634,1,0,0,0,139,641,1,0,0,0,141,650,1,0,0,0,
+ 143,144,5,60,0,0,144,145,5,112,0,0,145,146,5,114,0,0,146,147,5,101,0,0,
+ 147,151,1,0,0,0,148,150,8,0,0,0,149,148,1,0,0,0,150,153,1,0,0,0,151,149,
+ 1,0,0,0,151,152,1,0,0,0,152,154,1,0,0,0,153,151,1,0,0,0,154,155,5,62,0,
+ 0,155,156,5,60,0,0,156,157,5,99,0,0,157,158,5,111,0,0,158,159,5,100,0,
+ 0,159,160,5,101,0,0,160,164,1,0,0,0,161,163,8,0,0,0,162,161,1,0,0,0,163,
+ 166,1,0,0,0,164,162,1,0,0,0,164,165,1,0,0,0,165,167,1,0,0,0,166,164,1,
+ 0,0,0,167,168,5,62,0,0,168,169,1,0,0,0,169,170,6,0,0,0,170,8,1,0,0,0,171,
+ 172,5,60,0,0,172,173,5,112,0,0,173,186,5,62,0,0,174,175,5,60,0,0,175,176,
+ 5,112,0,0,176,177,5,32,0,0,177,181,1,0,0,0,178,180,8,0,0,0,179,178,1,0,
+ 0,0,180,183,1,0,0,0,181,179,1,0,0,0,181,182,1,0,0,0,182,184,1,0,0,0,183,
+ 181,1,0,0,0,184,186,5,62,0,0,185,171,1,0,0,0,185,174,1,0,0,0,186,187,1,
+ 0,0,0,187,188,6,1,1,0,188,10,1,0,0,0,189,190,5,60,0,0,190,191,5,98,0,0,
+ 191,192,5,108,0,0,192,193,5,111,0,0,193,194,5,99,0,0,194,195,5,107,0,0,
+ 195,196,5,113,0,0,196,197,5,117,0,0,197,198,5,111,0,0,198,199,5,116,0,
+ 0,199,200,5,101,0,0,200,204,1,0,0,0,201,203,8,0,0,0,202,201,1,0,0,0,203,
+ 206,1,0,0,0,204,202,1,0,0,0,204,205,1,0,0,0,205,207,1,0,0,0,206,204,1,
+ 0,0,0,207,208,5,62,0,0,208,209,1,0,0,0,209,210,6,2,2,0,210,12,1,0,0,0,
+ 211,213,7,1,0,0,212,211,1,0,0,0,213,214,1,0,0,0,214,212,1,0,0,0,214,215,
+ 1,0,0,0,215,216,1,0,0,0,216,217,6,3,3,0,217,14,1,0,0,0,218,220,9,0,0,0,
+ 219,218,1,0,0,0,220,223,1,0,0,0,221,222,1,0,0,0,221,219,1,0,0,0,222,224,
+ 1,0,0,0,223,221,1,0,0,0,224,225,5,60,0,0,225,226,5,47,0,0,226,227,5,112,
+ 0,0,227,228,5,62,0,0,228,229,1,0,0,0,229,230,6,4,4,0,230,16,1,0,0,0,231,
+ 232,5,60,0,0,232,233,5,112,0,0,233,234,5,114,0,0,234,235,5,101,0,0,235,
+ 239,1,0,0,0,236,238,8,0,0,0,237,236,1,0,0,0,238,241,1,0,0,0,239,237,1,
+ 0,0,0,239,240,1,0,0,0,240,242,1,0,0,0,241,239,1,0,0,0,242,243,5,62,0,0,
+ 243,244,5,60,0,0,244,245,5,99,0,0,245,246,5,111,0,0,246,247,5,100,0,0,
+ 247,248,5,101,0,0,248,252,1,0,0,0,249,251,8,0,0,0,250,249,1,0,0,0,251,
+ 254,1,0,0,0,252,250,1,0,0,0,252,253,1,0,0,0,253,255,1,0,0,0,254,252,1,
+ 0,0,0,255,256,5,62,0,0,256,257,1,0,0,0,257,258,6,5,0,0,258,18,1,0,0,0,
+ 259,260,5,60,0,0,260,261,5,112,0,0,261,274,5,62,0,0,262,263,5,60,0,0,263,
+ 264,5,112,0,0,264,265,5,32,0,0,265,269,1,0,0,0,266,268,8,0,0,0,267,266,
+ 1,0,0,0,268,271,1,0,0,0,269,267,1,0,0,0,269,270,1,0,0,0,270,272,1,0,0,
+ 0,271,269,1,0,0,0,272,274,5,62,0,0,273,259,1,0,0,0,273,262,1,0,0,0,274,
+ 275,1,0,0,0,275,276,6,6,1,0,276,20,1,0,0,0,277,278,5,60,0,0,278,279,5,
+ 47,0,0,279,280,5,98,0,0,280,281,5,108,0,0,281,282,5,111,0,0,282,283,5,
+ 99,0,0,283,284,5,107,0,0,284,285,5,113,0,0,285,286,5,117,0,0,286,287,5,
+ 111,0,0,287,288,5,116,0,0,288,289,5,101,0,0,289,290,5,62,0,0,290,291,1,
+ 0,0,0,291,292,6,7,4,0,292,22,1,0,0,0,293,295,7,1,0,0,294,293,1,0,0,0,295,
+ 296,1,0,0,0,296,294,1,0,0,0,296,297,1,0,0,0,297,298,1,0,0,0,298,299,6,
+ 8,3,0,299,24,1,0,0,0,300,301,5,60,0,0,301,302,5,47,0,0,302,303,5,99,0,
+ 0,303,304,5,111,0,0,304,305,5,100,0,0,305,306,5,101,0,0,306,307,5,62,0,
+ 0,307,308,5,60,0,0,308,309,5,47,0,0,309,310,5,112,0,0,310,311,5,114,0,
+ 0,311,312,5,101,0,0,312,313,5,62,0,0,313,314,1,0,0,0,314,315,6,9,4,0,315,
+ 26,1,0,0,0,316,317,5,60,0,0,317,318,5,115,0,0,318,319,5,112,0,0,319,320,
+ 5,97,0,0,320,321,5,110,0,0,321,322,1,0,0,0,322,323,6,10,5,0,323,28,1,0,
+ 0,0,324,326,3,33,13,0,325,324,1,0,0,0,326,329,1,0,0,0,327,325,1,0,0,0,
+ 327,328,1,0,0,0,328,330,1,0,0,0,329,327,1,0,0,0,330,332,5,46,0,0,331,333,
+ 3,33,13,0,332,331,1,0,0,0,333,334,1,0,0,0,334,332,1,0,0,0,334,335,1,0,
+ 0,0,335,30,1,0,0,0,336,338,3,33,13,0,337,336,1,0,0,0,338,339,1,0,0,0,339,
+ 337,1,0,0,0,339,340,1,0,0,0,340,32,1,0,0,0,341,342,7,2,0,0,342,34,1,0,
+ 0,0,343,344,5,40,0,0,344,36,1,0,0,0,345,346,5,41,0,0,346,38,1,0,0,0,347,
+ 348,5,42,0,0,348,349,5,61,0,0,349,40,1,0,0,0,350,351,5,47,0,0,351,352,
+ 5,61,0,0,352,42,1,0,0,0,353,354,5,43,0,0,354,355,5,61,0,0,355,44,1,0,0,
+ 0,356,357,5,45,0,0,357,358,5,61,0,0,358,46,1,0,0,0,359,360,5,42,0,0,360,
+ 48,1,0,0,0,361,362,5,47,0,0,362,50,1,0,0,0,363,364,5,43,0,0,364,52,1,0,
+ 0,0,365,366,5,45,0,0,366,54,1,0,0,0,367,368,3,57,25,0,368,369,5,61,0,0,
+ 369,56,1,0,0,0,370,376,5,62,0,0,371,372,5,38,0,0,372,373,5,103,0,0,373,
+ 374,5,116,0,0,374,376,5,59,0,0,375,370,1,0,0,0,375,371,1,0,0,0,376,58,
+ 1,0,0,0,377,378,3,61,27,0,378,379,5,61,0,0,379,60,1,0,0,0,380,386,5,60,
+ 0,0,381,382,5,38,0,0,382,383,5,108,0,0,383,384,5,116,0,0,384,386,5,59,
+ 0,0,385,380,1,0,0,0,385,381,1,0,0,0,386,62,1,0,0,0,387,388,5,61,0,0,388,
+ 389,5,61,0,0,389,64,1,0,0,0,390,391,5,33,0,0,391,392,5,61,0,0,392,66,1,
+ 0,0,0,393,394,5,38,0,0,394,406,5,38,0,0,395,396,5,38,0,0,396,397,5,97,
+ 0,0,397,398,5,109,0,0,398,399,5,112,0,0,399,400,5,59,0,0,400,401,5,38,
+ 0,0,401,402,5,97,0,0,402,403,5,109,0,0,403,404,5,112,0,0,404,406,5,59,
+ 0,0,405,393,1,0,0,0,405,395,1,0,0,0,406,68,1,0,0,0,407,408,5,124,0,0,408,
+ 409,5,124,0,0,409,70,1,0,0,0,410,411,5,61,0,0,411,72,1,0,0,0,412,413,5,
+ 33,0,0,413,74,1,0,0,0,414,415,5,44,0,0,415,76,1,0,0,0,416,417,5,123,0,
+ 0,417,78,1,0,0,0,418,419,5,125,0,0,419,80,1,0,0,0,420,421,5,116,0,0,421,
+ 422,5,114,0,0,422,423,5,117,0,0,423,430,5,101,0,0,424,425,5,102,0,0,425,
+ 426,5,97,0,0,426,427,5,108,0,0,427,428,5,115,0,0,428,430,5,101,0,0,429,
+ 420,1,0,0,0,429,424,1,0,0,0,430,82,1,0,0,0,431,432,5,97,0,0,432,433,5,
+ 98,0,0,433,469,5,115,0,0,434,435,5,109,0,0,435,436,5,97,0,0,436,469,5,
+ 120,0,0,437,438,5,109,0,0,438,439,5,105,0,0,439,469,5,110,0,0,440,441,
+ 5,114,0,0,441,442,5,97,0,0,442,443,5,110,0,0,443,444,5,100,0,0,444,445,
+ 5,111,0,0,445,469,5,109,0,0,446,447,5,114,0,0,447,448,5,111,0,0,448,449,
+ 5,108,0,0,449,469,5,108,0,0,450,451,5,114,0,0,451,452,5,111,0,0,452,453,
+ 5,117,0,0,453,454,5,110,0,0,454,469,5,100,0,0,455,456,5,115,0,0,456,457,
+ 5,113,0,0,457,469,5,114,0,0,458,459,5,115,0,0,459,460,5,113,0,0,460,461,
+ 5,114,0,0,461,469,5,116,0,0,462,463,5,118,0,0,463,464,5,105,0,0,464,465,
+ 5,115,0,0,465,466,5,105,0,0,466,467,5,116,0,0,467,469,5,115,0,0,468,431,
+ 1,0,0,0,468,434,1,0,0,0,468,437,1,0,0,0,468,440,1,0,0,0,468,446,1,0,0,
+ 0,468,450,1,0,0,0,468,455,1,0,0,0,468,458,1,0,0,0,468,462,1,0,0,0,469,
+ 84,1,0,0,0,470,471,5,115,0,0,471,472,5,104,0,0,472,473,5,111,0,0,473,474,
+ 5,119,0,0,474,86,1,0,0,0,475,476,5,114,0,0,476,477,5,101,0,0,477,478,5,
+ 115,0,0,478,479,5,101,0,0,479,489,5,116,0,0,480,481,5,114,0,0,481,482,
+ 5,101,0,0,482,483,5,115,0,0,483,484,5,101,0,0,484,485,5,116,0,0,485,486,
+ 5,65,0,0,486,487,5,108,0,0,487,489,5,108,0,0,488,475,1,0,0,0,488,480,1,
+ 0,0,0,489,88,1,0,0,0,490,491,5,105,0,0,491,492,5,102,0,0,492,90,1,0,0,
+ 0,493,494,5,101,0,0,494,495,5,108,0,0,495,496,5,115,0,0,496,497,5,101,
+ 0,0,497,92,1,0,0,0,498,499,5,101,0,0,499,500,5,108,0,0,500,501,5,115,0,
+ 0,501,502,5,101,0,0,502,503,5,105,0,0,503,504,5,102,0,0,504,94,1,0,0,0,
+ 505,506,5,101,0,0,506,507,5,110,0,0,507,508,5,100,0,0,508,509,5,105,0,
+ 0,509,510,5,102,0,0,510,96,1,0,0,0,511,512,5,97,0,0,512,513,5,110,0,0,
+ 513,514,5,100,0,0,514,98,1,0,0,0,515,516,5,111,0,0,516,517,5,114,0,0,517,
+ 100,1,0,0,0,518,519,5,105,0,0,519,520,5,115,0,0,520,102,1,0,0,0,521,522,
+ 5,110,0,0,522,523,5,111,0,0,523,524,5,116,0,0,524,104,1,0,0,0,525,529,
+ 5,34,0,0,526,528,3,107,50,0,527,526,1,0,0,0,528,531,1,0,0,0,529,527,1,
+ 0,0,0,529,530,1,0,0,0,530,532,1,0,0,0,531,529,1,0,0,0,532,542,5,34,0,0,
+ 533,537,5,39,0,0,534,536,3,107,50,0,535,534,1,0,0,0,536,539,1,0,0,0,537,
+ 535,1,0,0,0,537,538,1,0,0,0,538,540,1,0,0,0,539,537,1,0,0,0,540,542,5,
+ 39,0,0,541,525,1,0,0,0,541,533,1,0,0,0,542,106,1,0,0,0,543,547,8,3,0,0,
+ 544,545,5,92,0,0,545,547,7,4,0,0,546,543,1,0,0,0,546,544,1,0,0,0,547,108,
+ 1,0,0,0,548,552,7,5,0,0,549,551,7,6,0,0,550,549,1,0,0,0,551,554,1,0,0,
+ 0,552,550,1,0,0,0,552,553,1,0,0,0,553,110,1,0,0,0,554,552,1,0,0,0,555,
+ 557,7,1,0,0,556,555,1,0,0,0,557,558,1,0,0,0,558,556,1,0,0,0,558,559,1,
+ 0,0,0,559,560,1,0,0,0,560,561,6,52,3,0,561,112,1,0,0,0,562,563,5,62,0,
+ 0,563,564,1,0,0,0,564,565,6,53,6,0,565,114,1,0,0,0,566,570,7,7,0,0,567,
+ 569,7,8,0,0,568,567,1,0,0,0,569,572,1,0,0,0,570,568,1,0,0,0,570,571,1,
+ 0,0,0,571,116,1,0,0,0,572,570,1,0,0,0,573,574,5,61,0,0,574,575,1,0,0,0,
+ 575,576,6,55,7,0,576,118,1,0,0,0,577,578,5,47,0,0,578,579,5,115,0,0,579,
+ 580,5,112,0,0,580,581,5,97,0,0,581,582,5,110,0,0,582,583,5,62,0,0,583,
+ 584,1,0,0,0,584,585,6,56,4,0,585,120,1,0,0,0,586,587,7,1,0,0,587,588,1,
+ 0,0,0,588,589,6,57,3,0,589,122,1,0,0,0,590,591,5,60,0,0,591,592,1,0,0,
+ 0,592,593,6,58,4,0,593,124,1,0,0,0,594,596,8,9,0,0,595,594,1,0,0,0,596,
+ 597,1,0,0,0,597,595,1,0,0,0,597,598,1,0,0,0,598,126,1,0,0,0,599,601,5,
+ 32,0,0,600,599,1,0,0,0,601,604,1,0,0,0,602,600,1,0,0,0,602,603,1,0,0,0,
+ 603,605,1,0,0,0,604,602,1,0,0,0,605,606,3,129,61,0,606,607,1,0,0,0,607,
+ 608,6,60,4,0,608,128,1,0,0,0,609,615,3,139,66,0,610,615,3,141,67,0,611,
+ 615,3,131,62,0,612,615,3,135,64,0,613,615,3,137,65,0,614,609,1,0,0,0,614,
+ 610,1,0,0,0,614,611,1,0,0,0,614,612,1,0,0,0,614,613,1,0,0,0,615,130,1,
+ 0,0,0,616,618,3,133,63,0,617,616,1,0,0,0,618,619,1,0,0,0,619,617,1,0,0,
+ 0,619,620,1,0,0,0,620,622,1,0,0,0,621,623,5,32,0,0,622,621,1,0,0,0,622,
+ 623,1,0,0,0,623,132,1,0,0,0,624,626,7,10,0,0,625,624,1,0,0,0,626,134,1,
+ 0,0,0,627,629,5,35,0,0,628,630,7,11,0,0,629,628,1,0,0,0,630,631,1,0,0,
+ 0,631,629,1,0,0,0,631,632,1,0,0,0,632,136,1,0,0,0,633,635,7,2,0,0,634,
+ 633,1,0,0,0,635,636,1,0,0,0,636,634,1,0,0,0,636,637,1,0,0,0,637,639,1,
+ 0,0,0,638,640,5,37,0,0,639,638,1,0,0,0,639,640,1,0,0,0,640,138,1,0,0,0,
+ 641,645,5,34,0,0,642,644,8,12,0,0,643,642,1,0,0,0,644,647,1,0,0,0,645,
+ 643,1,0,0,0,645,646,1,0,0,0,646,648,1,0,0,0,647,645,1,0,0,0,648,649,5,
+ 34,0,0,649,140,1,0,0,0,650,654,5,39,0,0,651,653,8,13,0,0,652,651,1,0,0,
+ 0,653,656,1,0,0,0,654,652,1,0,0,0,654,655,1,0,0,0,655,657,1,0,0,0,656,
+ 654,1,0,0,0,657,658,5,39,0,0,658,142,1,0,0,0,46,0,1,2,3,4,5,6,151,164,
+ 181,185,204,214,221,239,252,269,273,296,327,334,339,375,385,405,429,468,
+ 488,529,537,541,546,552,558,570,597,602,614,619,622,625,631,636,639,645,
+ 654,8,5,3,0,5,1,0,5,2,0,6,0,0,4,0,0,5,4,0,5,5,0,5,6,0
+ };
+
+ public static readonly ATN _ATN =
+ new ATNDeserializer().Deserialize(_serializedATN);
+
+
+}
+} // namespace Arcweave.Interpreter
diff --git a/CSharp/Interpreter/Generated/ArcscriptParser.cs b/CSharp/Interpreter/Generated/ArcscriptParser.cs
new file mode 100644
index 0000000..64e57d7
--- /dev/null
+++ b/CSharp/Interpreter/Generated/ArcscriptParser.cs
@@ -0,0 +1,2634 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// ANTLR Version: 4.13.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from ArcscriptParser.g4 by ANTLR 4.13.1
+
+// Unreachable code detected
+#pragma warning disable 0162
+// The variable '...' is assigned but its value is never used
+#pragma warning disable 0219
+// Missing XML comment for publicly visible type or member '...'
+#pragma warning disable 1591
+// Ambiguous reference in cref attribute
+#pragma warning disable 419
+
+namespace Arcweave.Interpreter {
+using System;
+using System.IO;
+using System.Text;
+using System.Diagnostics;
+using System.Collections.Generic;
+using Antlr4.Runtime;
+using Antlr4.Runtime.Atn;
+using Antlr4.Runtime.Misc;
+using Antlr4.Runtime.Tree;
+using DFA = Antlr4.Runtime.Dfa.DFA;
+
+[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.1")]
+[System.CLSCompliant(false)]
+public partial class ArcscriptParser : ArcscriptParserBase {
+ protected static DFA[] decisionToDFA;
+ protected static PredictionContextCache sharedContextCache = new PredictionContextCache();
+ public const int
+ CODESTART=1, PARAGRAPHSTART=2, BLOCKQUOTESTART=3, NORMAL_WHITESPACE=4,
+ PARAGRAPHEND=5, BQ_CODESTART=6, BQ_PARAGRAPHSTART=7, BLOCKQUOTEEND=8,
+ BQ_WHITESPACE=9, CODEEND=10, MENTION_TAG_OPEN=11, FLOAT=12, INTEGER=13,
+ DIGIT=14, LPAREN=15, RPAREN=16, ASSIGNMUL=17, ASSIGNDIV=18, ASSIGNADD=19,
+ ASSIGNSUB=20, MUL=21, DIV=22, ADD=23, SUB=24, GE=25, GT=26, LE=27, LT=28,
+ EQ=29, NE=30, AND=31, OR=32, ASSIGN=33, NEG=34, COMMA=35, LBRACE=36, RBRACE=37,
+ BOOLEAN=38, FNAME=39, VFNAME=40, VFNAMEVARS=41, IFKEYWORD=42, ELSEKEYWORD=43,
+ ELSEIFKEYWORD=44, ENDIFKEYWORD=45, ANDKEYWORD=46, ORKEYWORD=47, ISKEYWORD=48,
+ NOTKEYWORD=49, STRING=50, VARIABLE=51, WHITESPACE=52, TAG_CLOSE=53, ATTR_NAME=54,
+ TAG_EQUALS=55, MENTION_TAG_CLOSE=56, TAG_WHITESPACE=57, TAG_OPEN=58, MENTION_LABEL=59,
+ ATTR_VALUE=60, ATTRIBUTE=61;
+ public const int
+ RULE_input = 0, RULE_script = 1, RULE_script_section = 2, RULE_blockquote = 3,
+ RULE_paragraph = 4, RULE_paragraph_start = 5, RULE_codestart = 6, RULE_codeend = 7,
+ RULE_assignment_segment = 8, RULE_function_call_segment = 9, RULE_conditional_section = 10,
+ RULE_if_section = 11, RULE_else_if_section = 12, RULE_else_section = 13,
+ RULE_if_clause = 14, RULE_else_if_clause = 15, RULE_endif_segment = 16,
+ RULE_statement_assignment = 17, RULE_statement_function_call = 18, RULE_argument_list = 19,
+ RULE_argument = 20, RULE_mention = 21, RULE_mention_attributes = 22, RULE_additive_numeric_expression = 23,
+ RULE_multiplicative_numeric_expression = 24, RULE_signed_unary_numeric_expression = 25,
+ RULE_unary_numeric_expression = 26, RULE_function_call = 27, RULE_void_function_call = 28,
+ RULE_sign = 29, RULE_variable_list = 30, RULE_compound_condition_or = 31,
+ RULE_compound_condition_and = 32, RULE_negated_unary_condition = 33, RULE_unary_condition = 34,
+ RULE_condition = 35, RULE_conditional_operator = 36, RULE_expression = 37;
+ public static readonly string[] ruleNames = {
+ "input", "script", "script_section", "blockquote", "paragraph", "paragraph_start",
+ "codestart", "codeend", "assignment_segment", "function_call_segment",
+ "conditional_section", "if_section", "else_if_section", "else_section",
+ "if_clause", "else_if_clause", "endif_segment", "statement_assignment",
+ "statement_function_call", "argument_list", "argument", "mention", "mention_attributes",
+ "additive_numeric_expression", "multiplicative_numeric_expression", "signed_unary_numeric_expression",
+ "unary_numeric_expression", "function_call", "void_function_call", "sign",
+ "variable_list", "compound_condition_or", "compound_condition_and", "negated_unary_condition",
+ "unary_condition", "condition", "conditional_operator", "expression"
+ };
+
+ private static readonly string[] _LiteralNames = {
+ null, null, null, null, null, null, null, null, "''", null,
+ "''", "''", null, null, "'/span>'",
+ null, "'<'"
+ };
+ private static readonly string[] _SymbolicNames = {
+ null, "CODESTART", "PARAGRAPHSTART", "BLOCKQUOTESTART", "NORMAL_WHITESPACE",
+ "PARAGRAPHEND", "BQ_CODESTART", "BQ_PARAGRAPHSTART", "BLOCKQUOTEEND",
+ "BQ_WHITESPACE", "CODEEND", "MENTION_TAG_OPEN", "FLOAT", "INTEGER", "DIGIT",
+ "LPAREN", "RPAREN", "ASSIGNMUL", "ASSIGNDIV", "ASSIGNADD", "ASSIGNSUB",
+ "MUL", "DIV", "ADD", "SUB", "GE", "GT", "LE", "LT", "EQ", "NE", "AND",
+ "OR", "ASSIGN", "NEG", "COMMA", "LBRACE", "RBRACE", "BOOLEAN", "FNAME",
+ "VFNAME", "VFNAMEVARS", "IFKEYWORD", "ELSEKEYWORD", "ELSEIFKEYWORD", "ENDIFKEYWORD",
+ "ANDKEYWORD", "ORKEYWORD", "ISKEYWORD", "NOTKEYWORD", "STRING", "VARIABLE",
+ "WHITESPACE", "TAG_CLOSE", "ATTR_NAME", "TAG_EQUALS", "MENTION_TAG_CLOSE",
+ "TAG_WHITESPACE", "TAG_OPEN", "MENTION_LABEL", "ATTR_VALUE", "ATTRIBUTE"
+ };
+ public static readonly IVocabulary DefaultVocabulary = new Vocabulary(_LiteralNames, _SymbolicNames);
+
+ [NotNull]
+ public override IVocabulary Vocabulary
+ {
+ get
+ {
+ return DefaultVocabulary;
+ }
+ }
+
+ public override string GrammarFileName { get { return "ArcscriptParser.g4"; } }
+
+ public override string[] RuleNames { get { return ruleNames; } }
+
+ public override int[] SerializedAtn { get { return _serializedATN; } }
+
+ static ArcscriptParser() {
+ decisionToDFA = new DFA[_ATN.NumberOfDecisions];
+ for (int i = 0; i < _ATN.NumberOfDecisions; i++) {
+ decisionToDFA[i] = new DFA(_ATN.GetDecisionState(i), i);
+ }
+ }
+
+ public ArcscriptParser(ITokenStream input) : this(input, Console.Out, Console.Error) { }
+
+ public ArcscriptParser(ITokenStream input, TextWriter output, TextWriter errorOutput)
+ : base(input, output, errorOutput)
+ {
+ Interpreter = new ParserATNSimulator(this, _ATN, decisionToDFA, sharedContextCache);
+ }
+
+ public partial class InputContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ScriptContext script() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode Eof() { return GetToken(ArcscriptParser.Eof, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public CodestartContext codestart() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Compound_condition_orContext compound_condition_or() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public CodeendContext codeend() {
+ return GetRuleContext(0);
+ }
+ public InputContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_input; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitInput(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public InputContext input() {
+ InputContext _localctx = new InputContext(Context, State);
+ EnterRule(_localctx, 0, RULE_input);
+ try {
+ State = 84;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,0,Context) ) {
+ case 1:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 76;
+ script();
+ State = 77;
+ Match(Eof);
+ }
+ break;
+ case 2:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 79;
+ codestart();
+ State = 80;
+ compound_condition_or();
+ State = 81;
+ codeend();
+ State = 82;
+ Match(Eof);
+ }
+ break;
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class ScriptContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public Script_sectionContext[] script_section() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Script_sectionContext script_section(int i) {
+ return GetRuleContext(i);
+ }
+ public ScriptContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_script; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitScript(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public ScriptContext script() {
+ ScriptContext _localctx = new ScriptContext(Context, State);
+ EnterRule(_localctx, 2, RULE_script);
+ try {
+ int _alt;
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 87;
+ ErrorHandler.Sync(this);
+ _alt = 1;
+ do {
+ switch (_alt) {
+ case 1:
+ {
+ {
+ State = 86;
+ script_section();
+ }
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ State = 89;
+ ErrorHandler.Sync(this);
+ _alt = Interpreter.AdaptivePredict(TokenStream,1,Context);
+ } while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER );
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Script_sectionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public BlockquoteContext[] blockquote() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public BlockquoteContext blockquote(int i) {
+ return GetRuleContext(i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ParagraphContext[] paragraph() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ParagraphContext paragraph(int i) {
+ return GetRuleContext(i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Assignment_segmentContext assignment_segment() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Function_call_segmentContext function_call_segment() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Conditional_sectionContext conditional_section() {
+ return GetRuleContext(0);
+ }
+ public Script_sectionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_script_section; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitScript_section(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Script_sectionContext script_section() {
+ Script_sectionContext _localctx = new Script_sectionContext(Context, State);
+ EnterRule(_localctx, 4, RULE_script_section);
+ try {
+ int _alt;
+ State = 104;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,4,Context) ) {
+ case 1:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 92;
+ ErrorHandler.Sync(this);
+ _alt = 1+1;
+ do {
+ switch (_alt) {
+ case 1+1:
+ {
+ {
+ State = 91;
+ blockquote();
+ }
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ State = 94;
+ ErrorHandler.Sync(this);
+ _alt = Interpreter.AdaptivePredict(TokenStream,2,Context);
+ } while ( _alt!=1 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER );
+ }
+ break;
+ case 2:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 97;
+ ErrorHandler.Sync(this);
+ _alt = 1+1;
+ do {
+ switch (_alt) {
+ case 1+1:
+ {
+ {
+ State = 96;
+ paragraph();
+ }
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ State = 99;
+ ErrorHandler.Sync(this);
+ _alt = Interpreter.AdaptivePredict(TokenStream,3,Context);
+ } while ( _alt!=1 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER );
+ }
+ break;
+ case 3:
+ EnterOuterAlt(_localctx, 3);
+ {
+ State = 101;
+ assignment_segment();
+ }
+ break;
+ case 4:
+ EnterOuterAlt(_localctx, 4);
+ {
+ State = 102;
+ function_call_segment();
+ }
+ break;
+ case 5:
+ EnterOuterAlt(_localctx, 5);
+ {
+ State = 103;
+ conditional_section();
+ }
+ break;
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class BlockquoteContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BLOCKQUOTESTART() { return GetToken(ArcscriptParser.BLOCKQUOTESTART, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BLOCKQUOTEEND() { return GetToken(ArcscriptParser.BLOCKQUOTEEND, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ParagraphContext[] paragraph() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ParagraphContext paragraph(int i) {
+ return GetRuleContext(i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Assignment_segmentContext[] assignment_segment() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Assignment_segmentContext assignment_segment(int i) {
+ return GetRuleContext(i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Function_call_segmentContext[] function_call_segment() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Function_call_segmentContext function_call_segment(int i) {
+ return GetRuleContext(i);
+ }
+ public BlockquoteContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_blockquote; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitBlockquote(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public BlockquoteContext blockquote() {
+ BlockquoteContext _localctx = new BlockquoteContext(Context, State);
+ EnterRule(_localctx, 6, RULE_blockquote);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 106;
+ Match(BLOCKQUOTESTART);
+ State = 112;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ while ((((_la) & ~0x3f) == 0 && ((1L << _la) & 198L) != 0)) {
+ {
+ State = 110;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,5,Context) ) {
+ case 1:
+ {
+ State = 107;
+ paragraph();
+ }
+ break;
+ case 2:
+ {
+ State = 108;
+ assignment_segment();
+ }
+ break;
+ case 3:
+ {
+ State = 109;
+ function_call_segment();
+ }
+ break;
+ }
+ }
+ State = 114;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ }
+ State = 115;
+ Match(BLOCKQUOTEEND);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class ParagraphContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public Paragraph_startContext paragraph_start() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode PARAGRAPHEND() { return GetToken(ArcscriptParser.PARAGRAPHEND, 0); }
+ public ParagraphContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_paragraph; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitParagraph(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public ParagraphContext paragraph() {
+ ParagraphContext _localctx = new ParagraphContext(Context, State);
+ EnterRule(_localctx, 8, RULE_paragraph);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 117;
+ paragraph_start();
+ State = 118;
+ Match(PARAGRAPHEND);
+ this.currentLine++;
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Paragraph_startContext : ParserRuleContext {
+ public IToken _PARAGRAPHSTART;
+ public IToken _BQ_PARAGRAPHSTART;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode PARAGRAPHSTART() { return GetToken(ArcscriptParser.PARAGRAPHSTART, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BQ_PARAGRAPHSTART() { return GetToken(ArcscriptParser.BQ_PARAGRAPHSTART, 0); }
+ public Paragraph_startContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_paragraph_start; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitParagraph_start(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Paragraph_startContext paragraph_start() {
+ Paragraph_startContext _localctx = new Paragraph_startContext(Context, State);
+ EnterRule(_localctx, 10, RULE_paragraph_start);
+ try {
+ State = 125;
+ ErrorHandler.Sync(this);
+ switch (TokenStream.LA(1)) {
+ case PARAGRAPHSTART:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 121;
+ _localctx._PARAGRAPHSTART = Match(PARAGRAPHSTART);
+ this.setLineStart(_localctx._PARAGRAPHSTART);
+ }
+ break;
+ case BQ_PARAGRAPHSTART:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 123;
+ _localctx._BQ_PARAGRAPHSTART = Match(BQ_PARAGRAPHSTART);
+ this.setLineStart(_localctx._BQ_PARAGRAPHSTART);
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class CodestartContext : ParserRuleContext {
+ public IToken _CODESTART;
+ public IToken _BQ_CODESTART;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CODESTART() { return GetToken(ArcscriptParser.CODESTART, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BQ_CODESTART() { return GetToken(ArcscriptParser.BQ_CODESTART, 0); }
+ public CodestartContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_codestart; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitCodestart(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public CodestartContext codestart() {
+ CodestartContext _localctx = new CodestartContext(Context, State);
+ EnterRule(_localctx, 12, RULE_codestart);
+ try {
+ State = 131;
+ ErrorHandler.Sync(this);
+ switch (TokenStream.LA(1)) {
+ case CODESTART:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 127;
+ _localctx._CODESTART = Match(CODESTART);
+ this.currentLine++; this.setLineStart(_localctx._CODESTART);
+ }
+ break;
+ case BQ_CODESTART:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 129;
+ _localctx._BQ_CODESTART = Match(BQ_CODESTART);
+ this.currentLine++; this.setLineStart(_localctx._BQ_CODESTART);
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class CodeendContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode CODEEND() { return GetToken(ArcscriptParser.CODEEND, 0); }
+ public CodeendContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_codeend; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitCodeend(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public CodeendContext codeend() {
+ CodeendContext _localctx = new CodeendContext(Context, State);
+ EnterRule(_localctx, 14, RULE_codeend);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 133;
+ Match(CODEEND);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Assignment_segmentContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public CodestartContext codestart() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Statement_assignmentContext statement_assignment() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public CodeendContext codeend() {
+ return GetRuleContext(0);
+ }
+ public Assignment_segmentContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_assignment_segment; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitAssignment_segment(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Assignment_segmentContext assignment_segment() {
+ Assignment_segmentContext _localctx = new Assignment_segmentContext(Context, State);
+ EnterRule(_localctx, 16, RULE_assignment_segment);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 135;
+ codestart();
+ State = 136;
+ statement_assignment();
+ State = 137;
+ codeend();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Function_call_segmentContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public CodestartContext codestart() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Statement_function_callContext statement_function_call() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public CodeendContext codeend() {
+ return GetRuleContext(0);
+ }
+ public Function_call_segmentContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_function_call_segment; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitFunction_call_segment(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Function_call_segmentContext function_call_segment() {
+ Function_call_segmentContext _localctx = new Function_call_segmentContext(Context, State);
+ EnterRule(_localctx, 18, RULE_function_call_segment);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 139;
+ codestart();
+ State = 140;
+ statement_function_call();
+ State = 141;
+ codeend();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Conditional_sectionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public If_sectionContext if_section() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Endif_segmentContext endif_segment() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Else_if_sectionContext[] else_if_section() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Else_if_sectionContext else_if_section(int i) {
+ return GetRuleContext(i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Else_sectionContext else_section() {
+ return GetRuleContext(0);
+ }
+ public Conditional_sectionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_conditional_section; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitConditional_section(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Conditional_sectionContext conditional_section() {
+ Conditional_sectionContext _localctx = new Conditional_sectionContext(Context, State);
+ EnterRule(_localctx, 20, RULE_conditional_section);
+ try {
+ int _alt;
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 143;
+ if_section();
+ State = 147;
+ ErrorHandler.Sync(this);
+ _alt = Interpreter.AdaptivePredict(TokenStream,9,Context);
+ while ( _alt!=2 && _alt!=global::Antlr4.Runtime.Atn.ATN.INVALID_ALT_NUMBER ) {
+ if ( _alt==1 ) {
+ {
+ {
+ State = 144;
+ else_if_section();
+ }
+ }
+ }
+ State = 149;
+ ErrorHandler.Sync(this);
+ _alt = Interpreter.AdaptivePredict(TokenStream,9,Context);
+ }
+ State = 151;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,10,Context) ) {
+ case 1:
+ {
+ State = 150;
+ else_section();
+ }
+ break;
+ }
+ State = 153;
+ endif_segment();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class If_sectionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public CodestartContext codestart() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public If_clauseContext if_clause() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public CodeendContext codeend() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ScriptContext script() {
+ return GetRuleContext(0);
+ }
+ public If_sectionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_if_section; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitIf_section(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public If_sectionContext if_section() {
+ If_sectionContext _localctx = new If_sectionContext(Context, State);
+ EnterRule(_localctx, 22, RULE_if_section);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 155;
+ codestart();
+ State = 156;
+ if_clause();
+ State = 157;
+ codeend();
+ State = 158;
+ script();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Else_if_sectionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public CodestartContext codestart() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Else_if_clauseContext else_if_clause() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public CodeendContext codeend() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ScriptContext script() {
+ return GetRuleContext(0);
+ }
+ public Else_if_sectionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_else_if_section; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitElse_if_section(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Else_if_sectionContext else_if_section() {
+ Else_if_sectionContext _localctx = new Else_if_sectionContext(Context, State);
+ EnterRule(_localctx, 24, RULE_else_if_section);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 160;
+ codestart();
+ State = 161;
+ else_if_clause();
+ State = 162;
+ codeend();
+ State = 163;
+ script();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Else_sectionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public CodestartContext codestart() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ELSEKEYWORD() { return GetToken(ArcscriptParser.ELSEKEYWORD, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public CodeendContext codeend() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ScriptContext script() {
+ return GetRuleContext(0);
+ }
+ public Else_sectionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_else_section; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitElse_section(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Else_sectionContext else_section() {
+ Else_sectionContext _localctx = new Else_sectionContext(Context, State);
+ EnterRule(_localctx, 26, RULE_else_section);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 165;
+ codestart();
+ State = 166;
+ Match(ELSEKEYWORD);
+ State = 167;
+ codeend();
+ State = 168;
+ script();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class If_clauseContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode IFKEYWORD() { return GetToken(ArcscriptParser.IFKEYWORD, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Compound_condition_orContext compound_condition_or() {
+ return GetRuleContext(0);
+ }
+ public If_clauseContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_if_clause; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitIf_clause(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public If_clauseContext if_clause() {
+ If_clauseContext _localctx = new If_clauseContext(Context, State);
+ EnterRule(_localctx, 28, RULE_if_clause);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 170;
+ Match(IFKEYWORD);
+ State = 171;
+ compound_condition_or();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Else_if_clauseContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ELSEIFKEYWORD() { return GetToken(ArcscriptParser.ELSEIFKEYWORD, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Compound_condition_orContext compound_condition_or() {
+ return GetRuleContext(0);
+ }
+ public Else_if_clauseContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_else_if_clause; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitElse_if_clause(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Else_if_clauseContext else_if_clause() {
+ Else_if_clauseContext _localctx = new Else_if_clauseContext(Context, State);
+ EnterRule(_localctx, 30, RULE_else_if_clause);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 173;
+ Match(ELSEIFKEYWORD);
+ State = 174;
+ compound_condition_or();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Endif_segmentContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public CodestartContext codestart() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ENDIFKEYWORD() { return GetToken(ArcscriptParser.ENDIFKEYWORD, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public CodeendContext codeend() {
+ return GetRuleContext(0);
+ }
+ public Endif_segmentContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_endif_segment; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitEndif_segment(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Endif_segmentContext endif_segment() {
+ Endif_segmentContext _localctx = new Endif_segmentContext(Context, State);
+ EnterRule(_localctx, 32, RULE_endif_segment);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 176;
+ codestart();
+ State = 177;
+ Match(ENDIFKEYWORD);
+ State = 178;
+ codeend();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Statement_assignmentContext : ParserRuleContext {
+ public IToken _VARIABLE;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode VARIABLE() { return GetToken(ArcscriptParser.VARIABLE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Compound_condition_orContext compound_condition_or() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGNADD() { return GetToken(ArcscriptParser.ASSIGNADD, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGNSUB() { return GetToken(ArcscriptParser.ASSIGNSUB, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGNMUL() { return GetToken(ArcscriptParser.ASSIGNMUL, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGNDIV() { return GetToken(ArcscriptParser.ASSIGNDIV, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ASSIGN() { return GetToken(ArcscriptParser.ASSIGN, 0); }
+ public Statement_assignmentContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_statement_assignment; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitStatement_assignment(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Statement_assignmentContext statement_assignment() {
+ Statement_assignmentContext _localctx = new Statement_assignmentContext(Context, State);
+ EnterRule(_localctx, 34, RULE_statement_assignment);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 180;
+ _localctx._VARIABLE = Match(VARIABLE);
+ State = 181;
+ _la = TokenStream.LA(1);
+ if ( !((((_la) & ~0x3f) == 0 && ((1L << _la) & 8591900672L) != 0)) ) {
+ ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ State = 182;
+ compound_condition_or();
+ this.assertVariable(_localctx._VARIABLE);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Statement_function_callContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public Void_function_callContext void_function_call() {
+ return GetRuleContext(0);
+ }
+ public Statement_function_callContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_statement_function_call; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitStatement_function_call(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Statement_function_callContext statement_function_call() {
+ Statement_function_callContext _localctx = new Statement_function_callContext(Context, State);
+ EnterRule(_localctx, 36, RULE_statement_function_call);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 185;
+ void_function_call();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Argument_listContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ArgumentContext[] argument() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ArgumentContext argument(int i) {
+ return GetRuleContext(i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(ArcscriptParser.COMMA); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
+ return GetToken(ArcscriptParser.COMMA, i);
+ }
+ public Argument_listContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_argument_list; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitArgument_list(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Argument_listContext argument_list() {
+ Argument_listContext _localctx = new Argument_listContext(Context, State);
+ EnterRule(_localctx, 38, RULE_argument_list);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 187;
+ argument();
+ State = 192;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ while (_la==COMMA) {
+ {
+ {
+ State = 188;
+ Match(COMMA);
+ State = 189;
+ argument();
+ }
+ }
+ State = 194;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class ArgumentContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public Additive_numeric_expressionContext additive_numeric_expression() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING() { return GetToken(ArcscriptParser.STRING, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public MentionContext mention() {
+ return GetRuleContext(0);
+ }
+ public ArgumentContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_argument; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitArgument(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public ArgumentContext argument() {
+ ArgumentContext _localctx = new ArgumentContext(Context, State);
+ EnterRule(_localctx, 40, RULE_argument);
+ try {
+ State = 198;
+ ErrorHandler.Sync(this);
+ switch (TokenStream.LA(1)) {
+ case FLOAT:
+ case INTEGER:
+ case LPAREN:
+ case ADD:
+ case SUB:
+ case FNAME:
+ case VARIABLE:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 195;
+ additive_numeric_expression();
+ }
+ break;
+ case STRING:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 196;
+ Match(STRING);
+ }
+ break;
+ case MENTION_TAG_OPEN:
+ EnterOuterAlt(_localctx, 3);
+ {
+ State = 197;
+ mention();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class MentionContext : ParserRuleContext {
+ public Mention_attributesContext _mention_attributes;
+ public IList _attr = new List();
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MENTION_TAG_OPEN() { return GetToken(ArcscriptParser.MENTION_TAG_OPEN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TAG_CLOSE() { return GetToken(ArcscriptParser.TAG_CLOSE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TAG_OPEN() { return GetToken(ArcscriptParser.TAG_OPEN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MENTION_TAG_CLOSE() { return GetToken(ArcscriptParser.MENTION_TAG_CLOSE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MENTION_LABEL() { return GetToken(ArcscriptParser.MENTION_LABEL, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Mention_attributesContext[] mention_attributes() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Mention_attributesContext mention_attributes(int i) {
+ return GetRuleContext(i);
+ }
+ public MentionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_mention; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitMention(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public MentionContext mention() {
+ MentionContext _localctx = new MentionContext(Context, State);
+ EnterRule(_localctx, 42, RULE_mention);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 200;
+ Match(MENTION_TAG_OPEN);
+ State = 204;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ while (_la==ATTR_NAME) {
+ {
+ {
+ State = 201;
+ _localctx._mention_attributes = mention_attributes();
+ _localctx._attr.Add(_localctx._mention_attributes);
+ }
+ }
+ State = 206;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ }
+ State = 207;
+ Match(TAG_CLOSE);
+ State = 209;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==MENTION_LABEL) {
+ {
+ State = 208;
+ Match(MENTION_LABEL);
+ }
+ }
+
+ State = 211;
+ Match(TAG_OPEN);
+ State = 212;
+ Match(MENTION_TAG_CLOSE);
+ State = 213;
+ if (!(this.assertMention(_localctx._attr))) throw new FailedPredicateException(this, "this.assertMention($attr)");
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Mention_attributesContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ATTR_NAME() { return GetToken(ArcscriptParser.ATTR_NAME, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode TAG_EQUALS() { return GetToken(ArcscriptParser.TAG_EQUALS, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ATTR_VALUE() { return GetToken(ArcscriptParser.ATTR_VALUE, 0); }
+ public Mention_attributesContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_mention_attributes; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitMention_attributes(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Mention_attributesContext mention_attributes() {
+ Mention_attributesContext _localctx = new Mention_attributesContext(Context, State);
+ EnterRule(_localctx, 44, RULE_mention_attributes);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 215;
+ Match(ATTR_NAME);
+ State = 218;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==TAG_EQUALS) {
+ {
+ State = 216;
+ Match(TAG_EQUALS);
+ State = 217;
+ Match(ATTR_VALUE);
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Additive_numeric_expressionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public Multiplicative_numeric_expressionContext multiplicative_numeric_expression() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Additive_numeric_expressionContext additive_numeric_expression() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ADD() { return GetToken(ArcscriptParser.ADD, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SUB() { return GetToken(ArcscriptParser.SUB, 0); }
+ public Additive_numeric_expressionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_additive_numeric_expression; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitAdditive_numeric_expression(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Additive_numeric_expressionContext additive_numeric_expression() {
+ Additive_numeric_expressionContext _localctx = new Additive_numeric_expressionContext(Context, State);
+ EnterRule(_localctx, 46, RULE_additive_numeric_expression);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 220;
+ multiplicative_numeric_expression();
+ State = 223;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==ADD || _la==SUB) {
+ {
+ State = 221;
+ _la = TokenStream.LA(1);
+ if ( !(_la==ADD || _la==SUB) ) {
+ ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ State = 222;
+ additive_numeric_expression();
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Multiplicative_numeric_expressionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public Signed_unary_numeric_expressionContext signed_unary_numeric_expression() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Multiplicative_numeric_expressionContext multiplicative_numeric_expression() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode MUL() { return GetToken(ArcscriptParser.MUL, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode DIV() { return GetToken(ArcscriptParser.DIV, 0); }
+ public Multiplicative_numeric_expressionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_multiplicative_numeric_expression; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitMultiplicative_numeric_expression(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Multiplicative_numeric_expressionContext multiplicative_numeric_expression() {
+ Multiplicative_numeric_expressionContext _localctx = new Multiplicative_numeric_expressionContext(Context, State);
+ EnterRule(_localctx, 48, RULE_multiplicative_numeric_expression);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 225;
+ signed_unary_numeric_expression();
+ State = 228;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==MUL || _la==DIV) {
+ {
+ State = 226;
+ _la = TokenStream.LA(1);
+ if ( !(_la==MUL || _la==DIV) ) {
+ ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ State = 227;
+ multiplicative_numeric_expression();
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Signed_unary_numeric_expressionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public SignContext sign() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Unary_numeric_expressionContext unary_numeric_expression() {
+ return GetRuleContext(0);
+ }
+ public Signed_unary_numeric_expressionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_signed_unary_numeric_expression; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitSigned_unary_numeric_expression(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Signed_unary_numeric_expressionContext signed_unary_numeric_expression() {
+ Signed_unary_numeric_expressionContext _localctx = new Signed_unary_numeric_expressionContext(Context, State);
+ EnterRule(_localctx, 50, RULE_signed_unary_numeric_expression);
+ try {
+ State = 234;
+ ErrorHandler.Sync(this);
+ switch (TokenStream.LA(1)) {
+ case ADD:
+ case SUB:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 230;
+ sign();
+ State = 231;
+ unary_numeric_expression();
+ }
+ break;
+ case FLOAT:
+ case INTEGER:
+ case LPAREN:
+ case FNAME:
+ case VARIABLE:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 233;
+ unary_numeric_expression();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Unary_numeric_expressionContext : ParserRuleContext {
+ public IToken _VARIABLE;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FLOAT() { return GetToken(ArcscriptParser.FLOAT, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode VARIABLE() { return GetToken(ArcscriptParser.VARIABLE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode INTEGER() { return GetToken(ArcscriptParser.INTEGER, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Function_callContext function_call() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LPAREN() { return GetToken(ArcscriptParser.LPAREN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Compound_condition_orContext compound_condition_or() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RPAREN() { return GetToken(ArcscriptParser.RPAREN, 0); }
+ public Unary_numeric_expressionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_unary_numeric_expression; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitUnary_numeric_expression(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Unary_numeric_expressionContext unary_numeric_expression() {
+ Unary_numeric_expressionContext _localctx = new Unary_numeric_expressionContext(Context, State);
+ EnterRule(_localctx, 52, RULE_unary_numeric_expression);
+ try {
+ State = 245;
+ ErrorHandler.Sync(this);
+ switch (TokenStream.LA(1)) {
+ case FLOAT:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 236;
+ Match(FLOAT);
+ }
+ break;
+ case VARIABLE:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 237;
+ _localctx._VARIABLE = Match(VARIABLE);
+ this.assertVariable(_localctx._VARIABLE);
+ }
+ break;
+ case INTEGER:
+ EnterOuterAlt(_localctx, 3);
+ {
+ State = 239;
+ Match(INTEGER);
+ }
+ break;
+ case FNAME:
+ EnterOuterAlt(_localctx, 4);
+ {
+ State = 240;
+ function_call();
+ }
+ break;
+ case LPAREN:
+ EnterOuterAlt(_localctx, 5);
+ {
+ State = 241;
+ Match(LPAREN);
+ State = 242;
+ compound_condition_or();
+ State = 243;
+ Match(RPAREN);
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Function_callContext : ParserRuleContext {
+ public IToken _FNAME;
+ public Argument_listContext _argument_list;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode FNAME() { return GetToken(ArcscriptParser.FNAME, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LPAREN() { return GetToken(ArcscriptParser.LPAREN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RPAREN() { return GetToken(ArcscriptParser.RPAREN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Argument_listContext argument_list() {
+ return GetRuleContext(0);
+ }
+ public Function_callContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_function_call; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitFunction_call(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Function_callContext function_call() {
+ Function_callContext _localctx = new Function_callContext(Context, State);
+ EnterRule(_localctx, 54, RULE_function_call);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 247;
+ _localctx._FNAME = Match(FNAME);
+ State = 248;
+ Match(LPAREN);
+ State = 250;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 3378249501554688L) != 0)) {
+ {
+ State = 249;
+ _localctx._argument_list = argument_list();
+ }
+ }
+
+ State = 252;
+ Match(RPAREN);
+ this.assertFunctionArguments(_localctx._FNAME, _localctx._argument_list);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Void_function_callContext : ParserRuleContext {
+ public IToken _VFNAME;
+ public Argument_listContext _argument_list;
+ public IToken _VFNAMEVARS;
+ public Variable_listContext _variable_list;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode VFNAME() { return GetToken(ArcscriptParser.VFNAME, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LPAREN() { return GetToken(ArcscriptParser.LPAREN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode RPAREN() { return GetToken(ArcscriptParser.RPAREN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Argument_listContext argument_list() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode VFNAMEVARS() { return GetToken(ArcscriptParser.VFNAMEVARS, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Variable_listContext variable_list() {
+ return GetRuleContext(0);
+ }
+ public Void_function_callContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_void_function_call; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitVoid_function_call(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Void_function_callContext void_function_call() {
+ Void_function_callContext _localctx = new Void_function_callContext(Context, State);
+ EnterRule(_localctx, 56, RULE_void_function_call);
+ int _la;
+ try {
+ State = 269;
+ ErrorHandler.Sync(this);
+ switch (TokenStream.LA(1)) {
+ case VFNAME:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 255;
+ _localctx._VFNAME = Match(VFNAME);
+ State = 256;
+ Match(LPAREN);
+ State = 258;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 3378249501554688L) != 0)) {
+ {
+ State = 257;
+ _localctx._argument_list = argument_list();
+ }
+ }
+
+ State = 260;
+ Match(RPAREN);
+ this.assertFunctionArguments(_localctx._VFNAME, _localctx._argument_list);
+ }
+ break;
+ case VFNAMEVARS:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 262;
+ _localctx._VFNAMEVARS = Match(VFNAMEVARS);
+ State = 263;
+ Match(LPAREN);
+ State = 265;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==VARIABLE) {
+ {
+ State = 264;
+ _localctx._variable_list = variable_list();
+ }
+ }
+
+ State = 267;
+ Match(RPAREN);
+ this.assertFunctionArguments(_localctx._VFNAMEVARS, _localctx._variable_list);
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class SignContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ADD() { return GetToken(ArcscriptParser.ADD, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode SUB() { return GetToken(ArcscriptParser.SUB, 0); }
+ public SignContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_sign; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitSign(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public SignContext sign() {
+ SignContext _localctx = new SignContext(Context, State);
+ EnterRule(_localctx, 58, RULE_sign);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 271;
+ _la = TokenStream.LA(1);
+ if ( !(_la==ADD || _la==SUB) ) {
+ ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Variable_listContext : ParserRuleContext {
+ public IToken _VARIABLE;
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] VARIABLE() { return GetTokens(ArcscriptParser.VARIABLE); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode VARIABLE(int i) {
+ return GetToken(ArcscriptParser.VARIABLE, i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode[] COMMA() { return GetTokens(ArcscriptParser.COMMA); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode COMMA(int i) {
+ return GetToken(ArcscriptParser.COMMA, i);
+ }
+ public Variable_listContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_variable_list; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitVariable_list(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Variable_listContext variable_list() {
+ Variable_listContext _localctx = new Variable_listContext(Context, State);
+ EnterRule(_localctx, 60, RULE_variable_list);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 273;
+ _localctx._VARIABLE = Match(VARIABLE);
+ State = 278;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ while (_la==COMMA) {
+ {
+ {
+ State = 274;
+ Match(COMMA);
+ State = 275;
+ _localctx._VARIABLE = Match(VARIABLE);
+ }
+ }
+ State = 280;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ }
+ this.assertVariable(_localctx._VARIABLE);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Compound_condition_orContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public Compound_condition_andContext compound_condition_and() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Compound_condition_orContext compound_condition_or() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode OR() { return GetToken(ArcscriptParser.OR, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ORKEYWORD() { return GetToken(ArcscriptParser.ORKEYWORD, 0); }
+ public Compound_condition_orContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_compound_condition_or; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitCompound_condition_or(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Compound_condition_orContext compound_condition_or() {
+ Compound_condition_orContext _localctx = new Compound_condition_orContext(Context, State);
+ EnterRule(_localctx, 62, RULE_compound_condition_or);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 283;
+ compound_condition_and();
+ State = 286;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==OR || _la==ORKEYWORD) {
+ {
+ State = 284;
+ _la = TokenStream.LA(1);
+ if ( !(_la==OR || _la==ORKEYWORD) ) {
+ ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ State = 285;
+ compound_condition_or();
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Compound_condition_andContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public Negated_unary_conditionContext negated_unary_condition() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Compound_condition_andContext compound_condition_and() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode AND() { return GetToken(ArcscriptParser.AND, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ANDKEYWORD() { return GetToken(ArcscriptParser.ANDKEYWORD, 0); }
+ public Compound_condition_andContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_compound_condition_and; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitCompound_condition_and(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Compound_condition_andContext compound_condition_and() {
+ Compound_condition_andContext _localctx = new Compound_condition_andContext(Context, State);
+ EnterRule(_localctx, 64, RULE_compound_condition_and);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 288;
+ negated_unary_condition();
+ State = 291;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==AND || _la==ANDKEYWORD) {
+ {
+ State = 289;
+ _la = TokenStream.LA(1);
+ if ( !(_la==AND || _la==ANDKEYWORD) ) {
+ ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ State = 290;
+ compound_condition_and();
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Negated_unary_conditionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public Unary_conditionContext unary_condition() {
+ return GetRuleContext(0);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NEG() { return GetToken(ArcscriptParser.NEG, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOTKEYWORD() { return GetToken(ArcscriptParser.NOTKEYWORD, 0); }
+ public Negated_unary_conditionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_negated_unary_condition; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitNegated_unary_condition(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Negated_unary_conditionContext negated_unary_condition() {
+ Negated_unary_conditionContext _localctx = new Negated_unary_conditionContext(Context, State);
+ EnterRule(_localctx, 66, RULE_negated_unary_condition);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 294;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if (_la==NEG || _la==NOTKEYWORD) {
+ {
+ State = 293;
+ _la = TokenStream.LA(1);
+ if ( !(_la==NEG || _la==NOTKEYWORD) ) {
+ ErrorHandler.RecoverInline(this);
+ }
+ else {
+ ErrorHandler.ReportMatch(this);
+ Consume();
+ }
+ }
+ }
+
+ State = 296;
+ unary_condition();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Unary_conditionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ConditionContext condition() {
+ return GetRuleContext(0);
+ }
+ public Unary_conditionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_unary_condition; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitUnary_condition(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Unary_conditionContext unary_condition() {
+ Unary_conditionContext _localctx = new Unary_conditionContext(Context, State);
+ EnterRule(_localctx, 68, RULE_unary_condition);
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 298;
+ condition();
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class ConditionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ExpressionContext[] expression() {
+ return GetRuleContexts();
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public ExpressionContext expression(int i) {
+ return GetRuleContext(i);
+ }
+ [System.Diagnostics.DebuggerNonUserCode] public Conditional_operatorContext conditional_operator() {
+ return GetRuleContext(0);
+ }
+ public ConditionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_condition; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitCondition(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public ConditionContext condition() {
+ ConditionContext _localctx = new ConditionContext(Context, State);
+ EnterRule(_localctx, 70, RULE_condition);
+ int _la;
+ try {
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 300;
+ expression();
+ State = 304;
+ ErrorHandler.Sync(this);
+ _la = TokenStream.LA(1);
+ if ((((_la) & ~0x3f) == 0 && ((1L << _la) & 281477090639872L) != 0)) {
+ {
+ State = 301;
+ conditional_operator();
+ State = 302;
+ expression();
+ }
+ }
+
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class Conditional_operatorContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GT() { return GetToken(ArcscriptParser.GT, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode GE() { return GetToken(ArcscriptParser.GE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LT() { return GetToken(ArcscriptParser.LT, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode LE() { return GetToken(ArcscriptParser.LE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode EQ() { return GetToken(ArcscriptParser.EQ, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NE() { return GetToken(ArcscriptParser.NE, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode ISKEYWORD() { return GetToken(ArcscriptParser.ISKEYWORD, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode NOTKEYWORD() { return GetToken(ArcscriptParser.NOTKEYWORD, 0); }
+ public Conditional_operatorContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_conditional_operator; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitConditional_operator(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public Conditional_operatorContext conditional_operator() {
+ Conditional_operatorContext _localctx = new Conditional_operatorContext(Context, State);
+ EnterRule(_localctx, 72, RULE_conditional_operator);
+ try {
+ State = 315;
+ ErrorHandler.Sync(this);
+ switch ( Interpreter.AdaptivePredict(TokenStream,29,Context) ) {
+ case 1:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 306;
+ Match(GT);
+ }
+ break;
+ case 2:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 307;
+ Match(GE);
+ }
+ break;
+ case 3:
+ EnterOuterAlt(_localctx, 3);
+ {
+ State = 308;
+ Match(LT);
+ }
+ break;
+ case 4:
+ EnterOuterAlt(_localctx, 4);
+ {
+ State = 309;
+ Match(LE);
+ }
+ break;
+ case 5:
+ EnterOuterAlt(_localctx, 5);
+ {
+ State = 310;
+ Match(EQ);
+ }
+ break;
+ case 6:
+ EnterOuterAlt(_localctx, 6);
+ {
+ State = 311;
+ Match(NE);
+ }
+ break;
+ case 7:
+ EnterOuterAlt(_localctx, 7);
+ {
+ State = 312;
+ Match(ISKEYWORD);
+ }
+ break;
+ case 8:
+ EnterOuterAlt(_localctx, 8);
+ {
+ State = 313;
+ Match(ISKEYWORD);
+ State = 314;
+ Match(NOTKEYWORD);
+ }
+ break;
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public partial class ExpressionContext : ParserRuleContext {
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode STRING() { return GetToken(ArcscriptParser.STRING, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public ITerminalNode BOOLEAN() { return GetToken(ArcscriptParser.BOOLEAN, 0); }
+ [System.Diagnostics.DebuggerNonUserCode] public Additive_numeric_expressionContext additive_numeric_expression() {
+ return GetRuleContext(0);
+ }
+ public ExpressionContext(ParserRuleContext parent, int invokingState)
+ : base(parent, invokingState)
+ {
+ }
+ public override int RuleIndex { get { return RULE_expression; } }
+ [System.Diagnostics.DebuggerNonUserCode]
+ public override TResult Accept(IParseTreeVisitor visitor) {
+ IArcscriptParserVisitor typedVisitor = visitor as IArcscriptParserVisitor;
+ if (typedVisitor != null) return typedVisitor.VisitExpression(this);
+ else return visitor.VisitChildren(this);
+ }
+ }
+
+ [RuleVersion(0)]
+ public ExpressionContext expression() {
+ ExpressionContext _localctx = new ExpressionContext(Context, State);
+ EnterRule(_localctx, 74, RULE_expression);
+ try {
+ State = 320;
+ ErrorHandler.Sync(this);
+ switch (TokenStream.LA(1)) {
+ case STRING:
+ EnterOuterAlt(_localctx, 1);
+ {
+ State = 317;
+ Match(STRING);
+ }
+ break;
+ case BOOLEAN:
+ EnterOuterAlt(_localctx, 2);
+ {
+ State = 318;
+ Match(BOOLEAN);
+ }
+ break;
+ case FLOAT:
+ case INTEGER:
+ case LPAREN:
+ case ADD:
+ case SUB:
+ case FNAME:
+ case VARIABLE:
+ EnterOuterAlt(_localctx, 3);
+ {
+ State = 319;
+ additive_numeric_expression();
+ }
+ break;
+ default:
+ throw new NoViableAltException(this);
+ }
+ }
+ catch (RecognitionException re) {
+ _localctx.exception = re;
+ ErrorHandler.ReportError(this, re);
+ ErrorHandler.Recover(this, re);
+ }
+ finally {
+ ExitRule();
+ }
+ return _localctx;
+ }
+
+ public override bool Sempred(RuleContext _localctx, int ruleIndex, int predIndex) {
+ switch (ruleIndex) {
+ case 21: return mention_sempred((MentionContext)_localctx, predIndex);
+ }
+ return true;
+ }
+ private bool mention_sempred(MentionContext _localctx, int predIndex) {
+ switch (predIndex) {
+ case 0: return this.assertMention(_localctx._attr);
+ }
+ return true;
+ }
+
+ private static int[] _serializedATN = {
+ 4,1,61,323,2,0,7,0,2,1,7,1,2,2,7,2,2,3,7,3,2,4,7,4,2,5,7,5,2,6,7,6,2,7,
+ 7,7,2,8,7,8,2,9,7,9,2,10,7,10,2,11,7,11,2,12,7,12,2,13,7,13,2,14,7,14,
+ 2,15,7,15,2,16,7,16,2,17,7,17,2,18,7,18,2,19,7,19,2,20,7,20,2,21,7,21,
+ 2,22,7,22,2,23,7,23,2,24,7,24,2,25,7,25,2,26,7,26,2,27,7,27,2,28,7,28,
+ 2,29,7,29,2,30,7,30,2,31,7,31,2,32,7,32,2,33,7,33,2,34,7,34,2,35,7,35,
+ 2,36,7,36,2,37,7,37,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,3,0,85,8,0,1,1,4,1,
+ 88,8,1,11,1,12,1,89,1,2,4,2,93,8,2,11,2,12,2,94,1,2,4,2,98,8,2,11,2,12,
+ 2,99,1,2,1,2,1,2,3,2,105,8,2,1,3,1,3,1,3,1,3,5,3,111,8,3,10,3,12,3,114,
+ 9,3,1,3,1,3,1,4,1,4,1,4,1,4,1,5,1,5,1,5,1,5,3,5,126,8,5,1,6,1,6,1,6,1,
+ 6,3,6,132,8,6,1,7,1,7,1,8,1,8,1,8,1,8,1,9,1,9,1,9,1,9,1,10,1,10,5,10,146,
+ 8,10,10,10,12,10,149,9,10,1,10,3,10,152,8,10,1,10,1,10,1,11,1,11,1,11,
+ 1,11,1,11,1,12,1,12,1,12,1,12,1,12,1,13,1,13,1,13,1,13,1,13,1,14,1,14,
+ 1,14,1,15,1,15,1,15,1,16,1,16,1,16,1,16,1,17,1,17,1,17,1,17,1,17,1,18,
+ 1,18,1,19,1,19,1,19,5,19,191,8,19,10,19,12,19,194,9,19,1,20,1,20,1,20,
+ 3,20,199,8,20,1,21,1,21,5,21,203,8,21,10,21,12,21,206,9,21,1,21,1,21,3,
+ 21,210,8,21,1,21,1,21,1,21,1,21,1,22,1,22,1,22,3,22,219,8,22,1,23,1,23,
+ 1,23,3,23,224,8,23,1,24,1,24,1,24,3,24,229,8,24,1,25,1,25,1,25,1,25,3,
+ 25,235,8,25,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,1,26,3,26,246,8,26,
+ 1,27,1,27,1,27,3,27,251,8,27,1,27,1,27,1,27,1,28,1,28,1,28,3,28,259,8,
+ 28,1,28,1,28,1,28,1,28,1,28,3,28,266,8,28,1,28,1,28,3,28,270,8,28,1,29,
+ 1,29,1,30,1,30,1,30,5,30,277,8,30,10,30,12,30,280,9,30,1,30,1,30,1,31,
+ 1,31,1,31,3,31,287,8,31,1,32,1,32,1,32,3,32,292,8,32,1,33,3,33,295,8,33,
+ 1,33,1,33,1,34,1,34,1,35,1,35,1,35,1,35,3,35,305,8,35,1,36,1,36,1,36,1,
+ 36,1,36,1,36,1,36,1,36,1,36,3,36,316,8,36,1,37,1,37,1,37,3,37,321,8,37,
+ 1,37,2,94,99,0,38,0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,
+ 38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70,72,74,0,6,2,0,17,20,
+ 33,33,1,0,23,24,1,0,21,22,2,0,32,32,47,47,2,0,31,31,46,46,2,0,34,34,49,
+ 49,330,0,84,1,0,0,0,2,87,1,0,0,0,4,104,1,0,0,0,6,106,1,0,0,0,8,117,1,0,
+ 0,0,10,125,1,0,0,0,12,131,1,0,0,0,14,133,1,0,0,0,16,135,1,0,0,0,18,139,
+ 1,0,0,0,20,143,1,0,0,0,22,155,1,0,0,0,24,160,1,0,0,0,26,165,1,0,0,0,28,
+ 170,1,0,0,0,30,173,1,0,0,0,32,176,1,0,0,0,34,180,1,0,0,0,36,185,1,0,0,
+ 0,38,187,1,0,0,0,40,198,1,0,0,0,42,200,1,0,0,0,44,215,1,0,0,0,46,220,1,
+ 0,0,0,48,225,1,0,0,0,50,234,1,0,0,0,52,245,1,0,0,0,54,247,1,0,0,0,56,269,
+ 1,0,0,0,58,271,1,0,0,0,60,273,1,0,0,0,62,283,1,0,0,0,64,288,1,0,0,0,66,
+ 294,1,0,0,0,68,298,1,0,0,0,70,300,1,0,0,0,72,315,1,0,0,0,74,320,1,0,0,
+ 0,76,77,3,2,1,0,77,78,5,0,0,1,78,85,1,0,0,0,79,80,3,12,6,0,80,81,3,62,
+ 31,0,81,82,3,14,7,0,82,83,5,0,0,1,83,85,1,0,0,0,84,76,1,0,0,0,84,79,1,
+ 0,0,0,85,1,1,0,0,0,86,88,3,4,2,0,87,86,1,0,0,0,88,89,1,0,0,0,89,87,1,0,
+ 0,0,89,90,1,0,0,0,90,3,1,0,0,0,91,93,3,6,3,0,92,91,1,0,0,0,93,94,1,0,0,
+ 0,94,95,1,0,0,0,94,92,1,0,0,0,95,105,1,0,0,0,96,98,3,8,4,0,97,96,1,0,0,
+ 0,98,99,1,0,0,0,99,100,1,0,0,0,99,97,1,0,0,0,100,105,1,0,0,0,101,105,3,
+ 16,8,0,102,105,3,18,9,0,103,105,3,20,10,0,104,92,1,0,0,0,104,97,1,0,0,
+ 0,104,101,1,0,0,0,104,102,1,0,0,0,104,103,1,0,0,0,105,5,1,0,0,0,106,112,
+ 5,3,0,0,107,111,3,8,4,0,108,111,3,16,8,0,109,111,3,18,9,0,110,107,1,0,
+ 0,0,110,108,1,0,0,0,110,109,1,0,0,0,111,114,1,0,0,0,112,110,1,0,0,0,112,
+ 113,1,0,0,0,113,115,1,0,0,0,114,112,1,0,0,0,115,116,5,8,0,0,116,7,1,0,
+ 0,0,117,118,3,10,5,0,118,119,5,5,0,0,119,120,6,4,-1,0,120,9,1,0,0,0,121,
+ 122,5,2,0,0,122,126,6,5,-1,0,123,124,5,7,0,0,124,126,6,5,-1,0,125,121,
+ 1,0,0,0,125,123,1,0,0,0,126,11,1,0,0,0,127,128,5,1,0,0,128,132,6,6,-1,
+ 0,129,130,5,6,0,0,130,132,6,6,-1,0,131,127,1,0,0,0,131,129,1,0,0,0,132,
+ 13,1,0,0,0,133,134,5,10,0,0,134,15,1,0,0,0,135,136,3,12,6,0,136,137,3,
+ 34,17,0,137,138,3,14,7,0,138,17,1,0,0,0,139,140,3,12,6,0,140,141,3,36,
+ 18,0,141,142,3,14,7,0,142,19,1,0,0,0,143,147,3,22,11,0,144,146,3,24,12,
+ 0,145,144,1,0,0,0,146,149,1,0,0,0,147,145,1,0,0,0,147,148,1,0,0,0,148,
+ 151,1,0,0,0,149,147,1,0,0,0,150,152,3,26,13,0,151,150,1,0,0,0,151,152,
+ 1,0,0,0,152,153,1,0,0,0,153,154,3,32,16,0,154,21,1,0,0,0,155,156,3,12,
+ 6,0,156,157,3,28,14,0,157,158,3,14,7,0,158,159,3,2,1,0,159,23,1,0,0,0,
+ 160,161,3,12,6,0,161,162,3,30,15,0,162,163,3,14,7,0,163,164,3,2,1,0,164,
+ 25,1,0,0,0,165,166,3,12,6,0,166,167,5,43,0,0,167,168,3,14,7,0,168,169,
+ 3,2,1,0,169,27,1,0,0,0,170,171,5,42,0,0,171,172,3,62,31,0,172,29,1,0,0,
+ 0,173,174,5,44,0,0,174,175,3,62,31,0,175,31,1,0,0,0,176,177,3,12,6,0,177,
+ 178,5,45,0,0,178,179,3,14,7,0,179,33,1,0,0,0,180,181,5,51,0,0,181,182,
+ 7,0,0,0,182,183,3,62,31,0,183,184,6,17,-1,0,184,35,1,0,0,0,185,186,3,56,
+ 28,0,186,37,1,0,0,0,187,192,3,40,20,0,188,189,5,35,0,0,189,191,3,40,20,
+ 0,190,188,1,0,0,0,191,194,1,0,0,0,192,190,1,0,0,0,192,193,1,0,0,0,193,
+ 39,1,0,0,0,194,192,1,0,0,0,195,199,3,46,23,0,196,199,5,50,0,0,197,199,
+ 3,42,21,0,198,195,1,0,0,0,198,196,1,0,0,0,198,197,1,0,0,0,199,41,1,0,0,
+ 0,200,204,5,11,0,0,201,203,3,44,22,0,202,201,1,0,0,0,203,206,1,0,0,0,204,
+ 202,1,0,0,0,204,205,1,0,0,0,205,207,1,0,0,0,206,204,1,0,0,0,207,209,5,
+ 53,0,0,208,210,5,59,0,0,209,208,1,0,0,0,209,210,1,0,0,0,210,211,1,0,0,
+ 0,211,212,5,58,0,0,212,213,5,56,0,0,213,214,4,21,0,1,214,43,1,0,0,0,215,
+ 218,5,54,0,0,216,217,5,55,0,0,217,219,5,60,0,0,218,216,1,0,0,0,218,219,
+ 1,0,0,0,219,45,1,0,0,0,220,223,3,48,24,0,221,222,7,1,0,0,222,224,3,46,
+ 23,0,223,221,1,0,0,0,223,224,1,0,0,0,224,47,1,0,0,0,225,228,3,50,25,0,
+ 226,227,7,2,0,0,227,229,3,48,24,0,228,226,1,0,0,0,228,229,1,0,0,0,229,
+ 49,1,0,0,0,230,231,3,58,29,0,231,232,3,52,26,0,232,235,1,0,0,0,233,235,
+ 3,52,26,0,234,230,1,0,0,0,234,233,1,0,0,0,235,51,1,0,0,0,236,246,5,12,
+ 0,0,237,238,5,51,0,0,238,246,6,26,-1,0,239,246,5,13,0,0,240,246,3,54,27,
+ 0,241,242,5,15,0,0,242,243,3,62,31,0,243,244,5,16,0,0,244,246,1,0,0,0,
+ 245,236,1,0,0,0,245,237,1,0,0,0,245,239,1,0,0,0,245,240,1,0,0,0,245,241,
+ 1,0,0,0,246,53,1,0,0,0,247,248,5,39,0,0,248,250,5,15,0,0,249,251,3,38,
+ 19,0,250,249,1,0,0,0,250,251,1,0,0,0,251,252,1,0,0,0,252,253,5,16,0,0,
+ 253,254,6,27,-1,0,254,55,1,0,0,0,255,256,5,40,0,0,256,258,5,15,0,0,257,
+ 259,3,38,19,0,258,257,1,0,0,0,258,259,1,0,0,0,259,260,1,0,0,0,260,261,
+ 5,16,0,0,261,270,6,28,-1,0,262,263,5,41,0,0,263,265,5,15,0,0,264,266,3,
+ 60,30,0,265,264,1,0,0,0,265,266,1,0,0,0,266,267,1,0,0,0,267,268,5,16,0,
+ 0,268,270,6,28,-1,0,269,255,1,0,0,0,269,262,1,0,0,0,270,57,1,0,0,0,271,
+ 272,7,1,0,0,272,59,1,0,0,0,273,278,5,51,0,0,274,275,5,35,0,0,275,277,5,
+ 51,0,0,276,274,1,0,0,0,277,280,1,0,0,0,278,276,1,0,0,0,278,279,1,0,0,0,
+ 279,281,1,0,0,0,280,278,1,0,0,0,281,282,6,30,-1,0,282,61,1,0,0,0,283,286,
+ 3,64,32,0,284,285,7,3,0,0,285,287,3,62,31,0,286,284,1,0,0,0,286,287,1,
+ 0,0,0,287,63,1,0,0,0,288,291,3,66,33,0,289,290,7,4,0,0,290,292,3,64,32,
+ 0,291,289,1,0,0,0,291,292,1,0,0,0,292,65,1,0,0,0,293,295,7,5,0,0,294,293,
+ 1,0,0,0,294,295,1,0,0,0,295,296,1,0,0,0,296,297,3,68,34,0,297,67,1,0,0,
+ 0,298,299,3,70,35,0,299,69,1,0,0,0,300,304,3,74,37,0,301,302,3,72,36,0,
+ 302,303,3,74,37,0,303,305,1,0,0,0,304,301,1,0,0,0,304,305,1,0,0,0,305,
+ 71,1,0,0,0,306,316,5,26,0,0,307,316,5,25,0,0,308,316,5,28,0,0,309,316,
+ 5,27,0,0,310,316,5,29,0,0,311,316,5,30,0,0,312,316,5,48,0,0,313,314,5,
+ 48,0,0,314,316,5,49,0,0,315,306,1,0,0,0,315,307,1,0,0,0,315,308,1,0,0,
+ 0,315,309,1,0,0,0,315,310,1,0,0,0,315,311,1,0,0,0,315,312,1,0,0,0,315,
+ 313,1,0,0,0,316,73,1,0,0,0,317,321,5,50,0,0,318,321,5,38,0,0,319,321,3,
+ 46,23,0,320,317,1,0,0,0,320,318,1,0,0,0,320,319,1,0,0,0,321,75,1,0,0,0,
+ 31,84,89,94,99,104,110,112,125,131,147,151,192,198,204,209,218,223,228,
+ 234,245,250,258,265,269,278,286,291,294,304,315,320
+ };
+
+ public static readonly ATN _ATN =
+ new ATNDeserializer().Deserialize(_serializedATN);
+
+
+}
+} // namespace Arcweave.Interpreter
diff --git a/CSharp/Interpreter/Generated/ArcscriptParserBaseVisitor.cs b/CSharp/Interpreter/Generated/ArcscriptParserBaseVisitor.cs
new file mode 100644
index 0000000..f3cb7c1
--- /dev/null
+++ b/CSharp/Interpreter/Generated/ArcscriptParserBaseVisitor.cs
@@ -0,0 +1,419 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// ANTLR Version: 4.13.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from ArcscriptParser.g4 by ANTLR 4.13.1
+
+// Unreachable code detected
+#pragma warning disable 0162
+// The variable '...' is assigned but its value is never used
+#pragma warning disable 0219
+// Missing XML comment for publicly visible type or member '...'
+#pragma warning disable 1591
+// Ambiguous reference in cref attribute
+#pragma warning disable 419
+
+namespace Arcweave.Interpreter {
+using Antlr4.Runtime.Misc;
+using Antlr4.Runtime.Tree;
+using IToken = Antlr4.Runtime.IToken;
+using ParserRuleContext = Antlr4.Runtime.ParserRuleContext;
+
+///
+/// This class provides an empty implementation of ,
+/// which can be extended to create a visitor which only needs to handle a subset
+/// of the available methods.
+///
+/// The return type of the visit operation.
+[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.1")]
+[System.Diagnostics.DebuggerNonUserCode]
+[System.CLSCompliant(false)]
+public partial class ArcscriptParserBaseVisitor : AbstractParseTreeVisitor, IArcscriptParserVisitor {
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitInput([NotNull] ArcscriptParser.InputContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitScript([NotNull] ArcscriptParser.ScriptContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitScript_section([NotNull] ArcscriptParser.Script_sectionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitBlockquote([NotNull] ArcscriptParser.BlockquoteContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitParagraph([NotNull] ArcscriptParser.ParagraphContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitParagraph_start([NotNull] ArcscriptParser.Paragraph_startContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitCodestart([NotNull] ArcscriptParser.CodestartContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitCodeend([NotNull] ArcscriptParser.CodeendContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitAssignment_segment([NotNull] ArcscriptParser.Assignment_segmentContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitFunction_call_segment([NotNull] ArcscriptParser.Function_call_segmentContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitConditional_section([NotNull] ArcscriptParser.Conditional_sectionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitIf_section([NotNull] ArcscriptParser.If_sectionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitElse_if_section([NotNull] ArcscriptParser.Else_if_sectionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitElse_section([NotNull] ArcscriptParser.Else_sectionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitIf_clause([NotNull] ArcscriptParser.If_clauseContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitElse_if_clause([NotNull] ArcscriptParser.Else_if_clauseContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitEndif_segment([NotNull] ArcscriptParser.Endif_segmentContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitStatement_assignment([NotNull] ArcscriptParser.Statement_assignmentContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitStatement_function_call([NotNull] ArcscriptParser.Statement_function_callContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitArgument_list([NotNull] ArcscriptParser.Argument_listContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitArgument([NotNull] ArcscriptParser.ArgumentContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitMention([NotNull] ArcscriptParser.MentionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitMention_attributes([NotNull] ArcscriptParser.Mention_attributesContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitAdditive_numeric_expression([NotNull] ArcscriptParser.Additive_numeric_expressionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitMultiplicative_numeric_expression([NotNull] ArcscriptParser.Multiplicative_numeric_expressionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitSigned_unary_numeric_expression([NotNull] ArcscriptParser.Signed_unary_numeric_expressionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitUnary_numeric_expression([NotNull] ArcscriptParser.Unary_numeric_expressionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitFunction_call([NotNull] ArcscriptParser.Function_callContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitVoid_function_call([NotNull] ArcscriptParser.Void_function_callContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitSign([NotNull] ArcscriptParser.SignContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitVariable_list([NotNull] ArcscriptParser.Variable_listContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitCompound_condition_or([NotNull] ArcscriptParser.Compound_condition_orContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitCompound_condition_and([NotNull] ArcscriptParser.Compound_condition_andContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitNegated_unary_condition([NotNull] ArcscriptParser.Negated_unary_conditionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitUnary_condition([NotNull] ArcscriptParser.Unary_conditionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitCondition([NotNull] ArcscriptParser.ConditionContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitConditional_operator([NotNull] ArcscriptParser.Conditional_operatorContext context) { return VisitChildren(context); }
+ ///
+ /// Visit a parse tree produced by .
+ ///
+ /// The default implementation returns the result of calling
+ /// on .
+ ///
+ ///
+ /// The parse tree.
+ /// The visitor result.
+ public virtual Result VisitExpression([NotNull] ArcscriptParser.ExpressionContext context) { return VisitChildren(context); }
+}
+} // namespace Arcweave.Interpreter
diff --git a/CSharp/Interpreter/Generated/ArcscriptParserVisitor.cs b/CSharp/Interpreter/Generated/ArcscriptParserVisitor.cs
new file mode 100644
index 0000000..51ce141
--- /dev/null
+++ b/CSharp/Interpreter/Generated/ArcscriptParserVisitor.cs
@@ -0,0 +1,264 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// ANTLR Version: 4.13.1
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+// Generated from ArcscriptParser.g4 by ANTLR 4.13.1
+
+// Unreachable code detected
+#pragma warning disable 0162
+// The variable '...' is assigned but its value is never used
+#pragma warning disable 0219
+// Missing XML comment for publicly visible type or member '...'
+#pragma warning disable 1591
+// Ambiguous reference in cref attribute
+#pragma warning disable 419
+
+namespace Arcweave.Interpreter {
+using Antlr4.Runtime.Misc;
+using Antlr4.Runtime.Tree;
+using IToken = Antlr4.Runtime.IToken;
+
+///
+/// This interface defines a complete generic visitor for a parse tree produced
+/// by .
+///
+/// The return type of the visit operation.
+[System.CodeDom.Compiler.GeneratedCode("ANTLR", "4.13.1")]
+[System.CLSCompliant(false)]
+public interface IArcscriptParserVisitor : IParseTreeVisitor {
+ ///
+ /// Visit a parse tree produced by