diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000000..59695180d6
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,68 @@
+
+[*.{appxmanifest,axml,build,c,c++,cc,cginc,compute,config,cp,cpp,csproj,cu,cuh,cxx,dbml,discomap,dtd,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,jsproj,lsproj,mpp,mq4,mq5,mqh,njsproj,nuspec,proj,props,proto,resw,resx,shader,StyleCop,targets,tasks,tpp,usf,ush,vbproj,xml,xsd}]
+indent_style = space
+indent_size = cs
+tab_width = 4
+
+[*.{asax,ascx,asmdef,aspx,axaml,cs,cshtml,css,htm,html,js,json,jsx,master,paml,razor,resjson,skin,ts,tsx,vb,xaml,xamlx,xoml}]
+indent_style = space
+indent_size = 4
+tab_width = 4
+
+[*]
+
+# Microsoft .NET properties
+csharp_new_line_before_members_in_object_initializers = false
+csharp_preferred_modifier_order = public, private, protected, internal, new, abstract, virtual, sealed, override, static, readonly, extern, unsafe, volatile, async:suggestion
+csharp_style_var_elsewhere = true:suggestion
+csharp_style_var_for_built_in_types = true:suggestion
+csharp_style_var_when_type_is_apparent = true:suggestion
+dotnet_naming_rule.private_constants_rule.severity = warning
+dotnet_naming_rule.private_constants_rule.style = upper_camel_case_style
+dotnet_naming_rule.private_constants_rule.symbols = private_constants_symbols
+dotnet_naming_rule.private_instance_fields_rule.severity = warning
+dotnet_naming_rule.private_instance_fields_rule.style = lower_camel_case_style
+dotnet_naming_rule.private_instance_fields_rule.symbols = private_instance_fields_symbols
+dotnet_naming_rule.private_static_fields_rule.severity = warning
+dotnet_naming_rule.private_static_fields_rule.style = lower_camel_case_style_1
+dotnet_naming_rule.private_static_fields_rule.symbols = private_static_fields_symbols
+dotnet_naming_rule.private_static_readonly_rule.severity = warning
+dotnet_naming_rule.private_static_readonly_rule.style = upper_camel_case_style
+dotnet_naming_rule.private_static_readonly_rule.symbols = private_static_readonly_symbols
+dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
+dotnet_naming_style.lower_camel_case_style_1.capitalization = camel_case
+dotnet_naming_style.lower_camel_case_style_1.required_prefix = _
+dotnet_naming_style.upper_camel_case_style.capitalization = pascal_case
+dotnet_naming_symbols.private_constants_symbols.applicable_accessibilities = private
+dotnet_naming_symbols.private_constants_symbols.applicable_kinds = field
+dotnet_naming_symbols.private_constants_symbols.required_modifiers = const
+dotnet_naming_symbols.private_instance_fields_symbols.applicable_accessibilities = private
+dotnet_naming_symbols.private_instance_fields_symbols.applicable_kinds = field
+dotnet_naming_symbols.private_static_fields_symbols.applicable_accessibilities = private
+dotnet_naming_symbols.private_static_fields_symbols.applicable_kinds = field
+dotnet_naming_symbols.private_static_fields_symbols.required_modifiers = static
+dotnet_naming_symbols.private_static_readonly_symbols.applicable_accessibilities = private
+dotnet_naming_symbols.private_static_readonly_symbols.applicable_kinds = field
+dotnet_naming_symbols.private_static_readonly_symbols.required_modifiers = static,readonly
+dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
+dotnet_style_parentheses_in_other_binary_operators = never_if_unnecessary:none
+dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
+dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
+dotnet_style_predefined_type_for_member_access = true:suggestion
+dotnet_style_qualification_for_event = false:suggestion
+dotnet_style_qualification_for_field = false:suggestion
+dotnet_style_qualification_for_method = false:suggestion
+dotnet_style_qualification_for_property = false:suggestion
+
+# ReSharper properties
+resharper_default_private_modifier = implicit
+
+# ReSharper inspection severities
+resharper_arrange_redundant_parentheses_highlighting = hint
+resharper_arrange_this_qualifier_highlighting = hint
+resharper_built_in_type_reference_style_for_member_access_highlighting = hint
+resharper_built_in_type_reference_style_highlighting = hint
+resharper_redundant_base_qualifier_highlighting = warning
+resharper_suggest_var_or_type_built_in_types_highlighting = hint
+resharper_suggest_var_or_type_elsewhere_highlighting = hint
+resharper_suggest_var_or_type_simple_types_highlighting = hint
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000000..9068a80499
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,33 @@
+* text=auto
+
+*.cs text eol=crlf
+
+*.h text eol=crlf
+*.c text eol=crlf
+*.cpp text eol=crlf
+
+*.as text eol=crlf
+*.hx text eol=crlf
+
+*.sln text eol=crlf
+*.csproj text eol=crlf
+*.vbproj text eol=crlf
+*.vcxproj text eol=crlf
+*.vcproj text eol=crlf
+*.dbproj text eol=crlf
+*.fsproj text eol=crlf
+*.lsproj text eol=crlf
+*.wixproj text eol=crlf
+*.modelproj text eol=crlf
+*.sqlproj text eol=crlf
+*.wmaproj text eol=crlf
+
+*.xproj text eol=crlf
+*.props text eol=crlf
+*.filters text eol=crlf
+*.vcxitems text eol=crlf
+
+*.bat text eol=crlf
+*.cmd text eol=crlf
+
+*.sh text eol=lf
diff --git a/.gitignore b/.gitignore
index b1443c2c01..c868e0da44 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,22 +1,39 @@
Thumbs.db
+*.config
+*.fda
+*.fdb
+*.fdl
+*.nupkg
+*.obj
+*.pdb
*.suo
*.user
-*.pdb
-*.obj
+*.vs/
*.vshost.exe
*.vshost.exe.manifest
-*.config
-*.fdb
-*.fdl
-*.fda
-obj/
-FlashDevelop/Properties/AssemblyInfo.cs
-FlashDevelop/Bin/Debug/FlashDevelop.*
-FlashDevelop/Bin/Debug/PluginCore.*
-FlashDevelop/Bin/Debug/Plugins/
-FlashDevelop/Bin/Debug/Data/
-FlashDevelop/Bin/Debug/Settings/FormStates/
-PluginCore/Bin
-/FlashDevelop/Bin/Debug/Settings/FileStates
-/FlashDevelop/Bin/Debug/Settings/Recovery
+**/obj/
+**/NSubstitute.*
+**/nunit.framework.*
+**/Castle.Core.*
+/FlashDevelop/Bin/Debug/Apps/
+/FlashDevelop/Bin/Debug/Data/
+/FlashDevelop/Bin/Debug/Plugins/
+/FlashDevelop/Bin/Debug/Settings/FileStates/
+/FlashDevelop/Bin/Debug/Settings/FormStates/
+/FlashDevelop/Bin/Debug/Settings/Recovery/
+/FlashDevelop/Bin/Debug/Settings/Themes/CURRENT
+/FlashDevelop/Bin/Debug/Tools/fdbuild/fdbuild.exe
+/FlashDevelop/Bin/Debug/*.Tests.dll
/FlashDevelop/Bin/Debug/Exceptions.log
+/FlashDevelop/Bin/Debug/FlashDevelop.*
+/FlashDevelop/Bin/Debug/FlashDevelop64.*
+/FlashDevelop/Bin/Debug/PluginCore.*
+/FlashDevelop/Properties/AssemblyInfo.cs
+/FlashDevelop/Scripting.*
+/FlashDevelop/Bin/Debug/CSScriptLibrary.*
+/FlashDevelop/Bin/Debug/Microsoft.*
+/FlashDevelop/Bin/Debug/System.*
+/FlashDevelop/Bin/Debug/Mono.*
+/packages/
+/PluginCore/Bin
+FlashDevelop/Bin/Debug/LitJSON.*
diff --git a/CI/README.md b/CI/README.md
new file mode 100644
index 0000000000..684e27f7d7
--- /dev/null
+++ b/CI/README.md
@@ -0,0 +1 @@
+Coming soon...
diff --git a/CI/build.cmd b/CI/build.cmd
index a68cfd19da..da152e4c7b 100644
--- a/CI/build.cmd
+++ b/CI/build.cmd
@@ -1,32 +1,58 @@
:: Builds the binary on the server for CI
:: Set paths
-set PATH=%PATH%;C:\Windows\Microsoft.NET\Framework\v4.0.30319\
-set PATH=%PATH%;C:\Program Files (x86)\Git\bin\
-set PATH=%PATH%;C:\Program Files\NSIS\
-set PATH=%PATH%;C:\Program Files\7-Zip\
+:: set PATH=%PATH%;C:\Windows\Microsoft.NET\Framework\v4.0.30319\
+:: set PATH=%PATH%;C:\Program Files (x86)\Git\bin\
+:: set PATH=%PATH%;C:\Program Files (x86)\NSIS
+:: set PATH=%PATH%;C:\Program Files\7-Zip\
-:: Reset bin files
-git clean -f -x -d FlashDevelop\Bin\Debug
+:flashdevelop
+
+:: Extract version from HEAD
+call SetVersion.bat
+
+:: Build the main solution and run tests
+msbuild FlashDevelop.sln /p:Configuration=Release+Tests /p:Platform="x64" /t:Rebuild %MSBuildLogger%
+
+:: Check for build errors
+if %errorlevel% neq 0 goto :error
+
+if "%AppVeyorCI%" neq "" powershell.exe -file ci\tests.ps1
+
+:: Check for build errors
+if %errorlevel% neq 0 goto :error
+
+:: Build the main solution and run tests
+msbuild FlashDevelop.sln /p:Configuration=Release+Tests /p:Platform="x86" /t:Rebuild %MSBuildLogger%
:: Check for build errors
if %errorlevel% neq 0 goto :error
-:: Build the PluginCore
-msbuild PluginCore\PluginCore.csproj /p:Configuration=Release /p:Platform=x86
+if "%AppVeyorCI%" neq "" powershell.exe -file ci\tests.ps1
:: Check for build errors
if %errorlevel% neq 0 goto :error
+git clean -xfd FlashDevelop\Bin\Debug
+
:: Extract version from HEAD
call SetVersion.bat
-:: Build the solution
-msbuild FlashDevelop.sln /p:Configuration=Release /p:Platform=x86
+nuget restore FlashDevelop.sln
+
+:: Build the solutions
+msbuild FlashDevelop.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Rebuild
+ping -n 5 127.0.0.1 > nul
+msbuild FlashDevelop.sln /p:Configuration=Release /p:Platform=x86 /t:Rebuild
:: Check for build errors
if %errorlevel% neq 0 goto :error
+:: Remove files after build
+del "FlashDevelop\Bin/Debug\System.*" /Q
+del "FlashDevelop\Bin/Debug\Microsoft.*" /Q
+del "FlashDevelop\Bin/Debug\Mono.CSharp.*" /Q
+
:: Create the installer
makensis FlashDevelop\Installer\Installer.nsi
@@ -39,8 +65,60 @@ if %errorlevel% neq 0 goto :error
:: Check for 7zip errors
if %errorlevel% neq 0 goto :error
+:haxedevelop
+
+:: Reset bin files
+git clean -xfd FlashDevelop\Bin\Debug
+
+:: Remove unnecessary files
+rd "FlashDevelop\Bin\Debug\Tools\flexpmd" /s /q
+rd "FlashDevelop\Bin\Debug\Tools\flexlibs\frameworks\libs\player" /s /q
+for /d %%G in ("FlashDevelop\Bin\Debug\Projects\*ActionScript 3*") do rd /s /q "%%~G"
+del "FlashDevelop\Bin\Debug\StartPage\images\*.*" /q
+
+:: Copy distro files
+xcopy Distros\HaxeDevelop /s /e /y
+
+:: Check for build errors
+if %errorlevel% neq 0 goto :error
+
+:: Extract version from HEAD
+call SetVersion.bat
+
+:: Build the solutions
+msbuild FlashDevelop.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Rebuild
+ping -n 5 127.0.0.1 > nul
+msbuild FlashDevelop.sln /p:Configuration=Release /p:Platform=x86 /t:Rebuild
+
+:: Check for build errors
+if %errorlevel% neq 0 goto :error
+
+:: Remove files after build
+del "FlashDevelop\Bin\Debug\Plugins\CodeAnalyzer.dll" /q
+del "FlashDevelop\Bin/Debug\System.*" /Q
+del "FlashDevelop\Bin/Debug\Microsoft.*" /Q
+del "FlashDevelop\Bin/Debug\Mono.CSharp.*" /Q
+
+:: Rename binaries
+ren FlashDevelop\Bin\Debug\FlashDevelop.exe HaxeDevelop.exe
+ren FlashDevelop\Bin\Debug\FlashDevelop64.exe HaxeDevelop64.exe
+ren FlashDevelop\Bin\Debug\FlashDevelop.exe.config HaxeDevelop.exe.config
+ren FlashDevelop\Bin\Debug\FlashDevelop64.exe.config HaxeDevelop64.exe.config
+
+:: Check for build errors
+if %errorlevel% neq 0 goto :error
+
+:: Create the installer
+makensis FlashDevelop\Installer\Installer.nsi
+
+:: Check for nsis errors
+if %errorlevel% neq 0 goto :error
+
+:: Create the archive
+7z a -tzip FlashDevelop\Installer\Binary\HaxeDevelop.zip .\FlashDevelop\Bin\Debug\* -xr!.empty
+
:: Done
-exit
+exit 0
:error
-exit -1
+exit -1
\ No newline at end of file
diff --git a/CI/buildl.cmd b/CI/buildl.cmd
index 272551c06c..877a1a6ada 100644
--- a/CI/buildl.cmd
+++ b/CI/buildl.cmd
@@ -1,22 +1,30 @@
:: Builds the binary locally and launches the installer
:: Set paths
-set PATH=%PATH%;C:\Windows\Microsoft.NET\Framework\v4.0.30319\
-set PATH=%PATH%;C:\Program Files (x86)\Git\bin\
-set PATH=%PATH%;C:\Program Files (x86)\NSIS
-set PATH=%PATH%;C:\Program Files\7-Zip\
+:: set PATH=%PATH%;C:\Program Files (x86)\MSBuild\15.0\Bin\
+:: set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin
+:: set PATH=%PATH%;C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\MSBuild\Current\Bin
+:: set PATH=%PATH%;C:\Program Files\Git\bin\
+:: set PATH=%PATH%;C:\Program Files (x86)\Git\bin\
+:: set PATH=%PATH%;C:\Program Files\7-Zip\
+:: set PATH=%PATH%;C:\Program Files (x86)\7-Zip\
+:: set PATH=%PATH%;C:\Program Files (x86)\NSIS
:: Need path up
cd ..
+:flashdevelop
+
:: Reset bin files
git clean -f -x -d FlashDevelop\Bin\Debug
+del FlashDevelop\Installer\Binary\*.exe /Q
+del FlashDevelop\Installer\Binary\*.zip /Q
:: Check for build errors
if %errorlevel% neq 0 goto :error
:: Build the PluginCore
-msbuild PluginCore\PluginCore.csproj /p:Configuration=Release /p:Platform=x86 /t:Rebuild
+msbuild PluginCore\PluginCore.csproj /p:Configuration=Release /p:Platform="AnyCPU" /t:Rebuild
:: Check for build errors
if %errorlevel% neq 0 goto :error
@@ -24,7 +32,9 @@ if %errorlevel% neq 0 goto :error
:: Extract version from HEAD
call SetVersion.bat
-:: Build the solution
+:: Build the solutions
+msbuild FlashDevelop.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Rebuild
+ping -n 5 127.0.0.1 > nul
msbuild FlashDevelop.sln /p:Configuration=Release /p:Platform=x86 /t:Rebuild
:: Check for build errors
@@ -36,16 +46,73 @@ makensis FlashDevelop\Installer\Installer.nsi
:: Check for nsis errors
if %errorlevel% neq 0 goto :error
-:: Delete old and create an new archive
-del FlashDevelop\Installer\Binary\FlashDevelop.zip
+:: Create the archive
7z a -tzip FlashDevelop\Installer\Binary\FlashDevelop.zip .\FlashDevelop\Bin\Debug\* -xr!.empty
:: Check for 7zip errors
if %errorlevel% neq 0 goto :error
-:: Done
+:haxedevelop
+
+:: Reset bin files
+git clean -f -x -d FlashDevelop\Bin\Debug
+
+:: Remove unnecessary files
+rd "FlashDevelop\Bin\Debug\Tools\flexpmd" /s /q
+rd "FlashDevelop\Bin\Debug\Tools\flexlibs\frameworks\libs\player" /s /q
+for /d %%G in ("FlashDevelop\Bin\Debug\Projects\*ActionScript 3*") do rd /s /q "%%~G"
+del "FlashDevelop\Bin\Debug\StartPage\images\*.*" /q
+
+:: Copy distro files
+xcopy Distros\HaxeDevelop /s /e /y
+
+:: Build the PluginCore
+msbuild PluginCore\PluginCore.csproj /p:Configuration=Release /p:Platform="AnyCPU" /t:Rebuild
+
+:: Check for build errors
+if %errorlevel% neq 0 goto :error
+
+:: Extract version from HEAD
+call SetVersion.bat
+
+:: Build the solutions
+msbuild FlashDevelop.sln /p:Configuration=Release /p:Platform="Any CPU" /t:Rebuild
+ping -n 5 127.0.0.1 > nul
+msbuild FlashDevelop.sln /p:Configuration=Release /p:Platform=x86 /t:Rebuild
+
+:: Check for build errors
+if %errorlevel% neq 0 goto :error
+
+:: Rename binaries
+ren FlashDevelop\Bin\Debug\FlashDevelop.exe HaxeDevelop.exe
+ren FlashDevelop\Bin\Debug\FlashDevelop64.exe HaxeDevelop64.exe
+ren FlashDevelop\Bin\Debug\FlashDevelop.exe.config HaxeDevelop.exe.config
+ren FlashDevelop\Bin\Debug\FlashDevelop64.exe.config HaxeDevelop64.exe.config
+
+: Remove files after build
+del "FlashDevelop\Bin\Debug\Plugins\CodeAnalyzer.dll" /q
+
+:: Check for build errors
+if %errorlevel% neq 0 goto :error
+
+:: Create the installer
+makensis FlashDevelop\Installer\Installer.nsi
+
+:: Check for nsis errors
+if %errorlevel% neq 0 goto :error
+
+:: Create the archive
+7z a -tzip FlashDevelop\Installer\Binary\HaxeDevelop.zip .\FlashDevelop\Bin\Debug\* -xr!.empty
+
+:finish
+
+:: Revert distro changes with backup
+git stash save "Local CI Backup..."
+
+:: Done, Run FD
start FlashDevelop\Installer\Binary\FlashDevelop.exe
-exit
+exit 0
:error
+pause
exit -1
diff --git a/CI/deploy.ps1 b/CI/deploy.ps1
index 3b4df435ef..1c28c40d6b 100644
--- a/CI/deploy.ps1
+++ b/CI/deploy.ps1
@@ -13,6 +13,9 @@ Param (
$projectBuildNumber
)
+$fd = $false;
+$hd = $false;
+$fdpr = $false; # Unused at the moment
$login = $variables["SecureLogin"]
$pass = $variables["SecurePass"]
@@ -21,13 +24,33 @@ foreach($artifact in $artifacts.values)
Write-Output "Upload artifact: $($artifact.name)"
$ext = [System.IO.Path]::GetExtension($artifact.name)
$name = [System.IO.Path]::GetFileNameWithoutExtension($artifact.name)
- ncftpput.exe -u "$login" -p "$pass" -C ftp.flashdevelop.org "$($artifact.path)" "downloads/builds/$name$ext";
+
+ IF ($name -like "FlashDevelopPR_*") { $fdpr = $true; }
+ ELSEIF ($name -like "FlashDevelop*") { $fd = $true; }
+ ELSEIF ($name -like "HaxeDevelop*") { $hd = $true; }
+
+ IF ($ext -eq ".xml")
+ {
+ # Upload appman.xml file
+ ncftpput.exe -u "$login" -p "$pass" -C ftp.flashdevelop.org "$($artifact.path)" "$name$ext";
+ }
+ ELSE
+ {
+ # Upload the installer and the zip archive
+ ncftpput.exe -u "$login" -p "$pass" -C ftp.flashdevelop.org "$($artifact.path)" "downloads/builds/$name$ext";
+ }
}
-Write-Output "Create and upload LATEST_BUILD.txt"
+Write-Output "Create and upload build info."
$date = Get-Date
$file = [System.IO.Path]::GetTempFileName()
-$name = [System.IO.Path]::GetFileNameWithoutExtension($artifact.name)
$data = "Build: $projectVersion`r`nTime: " + $date.ToUniversalTime() + " GMT"
$data | Set-Content $file
-ncftpput.exe -u "$login" -p "$pass" -C ftp.flashdevelop.org "$file" "downloads/builds/$name.txt";
+IF ($fd)
+{
+ ncftpput.exe -u "$login" -p "$pass" -C ftp.flashdevelop.org "$file" "downloads/builds/FlashDevelop-$env:APPVEYOR_REPO_BRANCH.txt";
+}
+IF ($hd)
+{
+ ncftpput.exe -u "$login" -p "$pass" -C ftp.flashdevelop.org "$file" "downloads/builds/HaxeDevelop-$env:APPVEYOR_REPO_BRANCH.txt";
+}
\ No newline at end of file
diff --git a/CI/deploya.ps1 b/CI/deploya.ps1
deleted file mode 100644
index 3e8413fbd7..0000000000
--- a/CI/deploya.ps1
+++ /dev/null
@@ -1,25 +0,0 @@
-# Deploys the appman.xml config to the FD.org server
-
-Param (
- $variables = @{},
- $artifacts = @{},
- $scriptPath,
- $buildFolder,
- $srcFolder,
- $outFolder,
- $tempFolder,
- $projectName,
- $projectVersion,
- $projectBuildNumber
-)
-
-$login = $variables["SecureLogin"]
-$pass = $variables["SecurePass"]
-
-foreach($artifact in $artifacts.values)
-{
- Write-Output "Upload artifact: $($artifact.name)"
- $ext = [System.IO.Path]::GetExtension($artifact.name)
- $name = [System.IO.Path]::GetFileNameWithoutExtension($artifact.name)
- ncftpput.exe -u "$login" -p "$pass" -C ftp.flashdevelop.org "$($artifact.path)" "$name$ext";
-}
diff --git a/CI/tests.ps1 b/CI/tests.ps1
new file mode 100644
index 0000000000..047c27f0db
--- /dev/null
+++ b/CI/tests.ps1
@@ -0,0 +1,57 @@
+# Runs the unit tests, and uploads them to the CI server
+
+Param (
+ $variables = @{},
+ $scriptPath,
+ $buildFolder,
+ $srcFolder,
+ $outFolder,
+ $tempFolder,
+ $projectName,
+ $projectVersion,
+ $projectBuildNumber
+)
+
+If ($env:HAXEPATH -eq $null)
+{
+ cinst.exe haxe --version 4.1.4 -y --no-progress
+ $env:HAXEPATH = [System.IO.Directory]::GetDirectories("C:\ProgramData\chocolatey\lib\haxe", "haxe_*")[0];
+ If ($env:HAXEPATH -eq $null)
+ {
+ Write-Output "HAXEPATH is invalid"
+ exit 1
+ }
+}
+
+If ((Get-Command "nunit3-console.exe" -ErrorAction SilentlyContinue) -ne $null)
+{
+ $path = [System.IO.Directory]::GetCurrentDirectory() + "\FlashDevelop\Bin\Debug"
+ $testFiles = [System.IO.Directory]::GetFiles($path, "*.Tests.dll")
+ IF ($testFiles.Count -eq 0)
+ {
+ Write-Output "No test assemblies found"
+ exit 1
+ }
+
+ cd $path
+ #nunit3-console.exe $testFiles --result=myresults.xml;format=AppVeyor
+ #nunit3-console.exe $testFiles --x86
+ nunit3-console.exe $testFiles
+
+ #It turns out it's not needed to upload the file
+ #if ((Test-Path env:\APPVEYOR_JOB_ID) -And (Test-Path TestResult.xml))
+ #{
+ # $wc = New-Object 'System.Net.WebClient'
+ # $wc.UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\TestResult.xml))
+ #}
+
+ if ($LASTEXITCODE -ne 0)
+ {
+ exit 1
+ }
+}
+ELSE
+{
+ Write-Output "NUnit runner not found"
+ exit 1
+}
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000000..d0d8379463
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,208 @@
+# AppMan entries
+
+If you want to add your plugin, theme or extension to AppMan, you need to do a pull request to the `appman.xml` file adding a new entry inside the FD5 comments. Requirements for the offered plugins, themes or extensions are:
+
+* Code needs to be open source and reviewable in a public repository
+* The item needs to be packaged into a `.fdz` file and provide a MD5 checksum for verification
+* The `.fdz` needs to extract the files to the automated plugin directory: `$(BaseDir)/Plugins`
+
+# Coding style
+
+##### Use spaces instead of tabs with a width of 4
+
+```c#
+public bool IsMember()
+{
+ if (this.value > 2)
+ {
+ return false;
+ }
+ else return true;
+}
+```
+
+##### Naming should be in English and clear
+
+```c#
+private int memberProperty = 0;
+```
+
+##### Use camelCase for private members and uppercase for public properties, methods and types:
+
+```c#
+private int memberProperty = 0;
+
+public string MemberName = "MemberName";
+
+public bool IsMember()
+{
+ return true;
+}
+```
+
+##### Use types without explicit path:
+
+```c#
+private void OnFormActivate(object sender, /*System.*/EventArgs e)
+{
+ // Do something...
+}
+```
+
+##### Do not use extensive extra empty lines and keep the code clean, not like:
+
+```c#
+// Comment...
+private int MemberMethod(int value)
+{
+
+
+
+ // Comment for something...
+
+
+ if (value > 2))
+ {
+
+ //this.oldCode = 0;
+
+
+ // Random notes here
+
+
+
+ return -1;
+ }
+
+
+
+ // Something here too...
+ else return value;
+
+
+
+
+ //Little bit here too...
+}
+```
+
+##### Use brackets and parenthesis for easier readability:
+
+```c#
+if ((val1 > val2) && (val1 > val3))
+{
+ if (val2 > val3)
+ {
+ doThing();
+ }
+}
+```
+
+##### Do not nest expressions without brackets:
+
+```c#
+if (val1 > val2 && val1 > val3)
+
+ if (val2 > val3)
+
+ doThing();
+
+```
+
+##### Use can use one liners to shorten the code:
+
+```c#
+if (val1 > val2 && val1 > val3)
+{
+ if (val2 > val3) doThing();
+}
+```
+
+##### Use explicit types:
+
+```c#
+int myValue = 0;
+Point[] myPoints = new Point[]
+{
+ new Point(1, 1),
+ new Point(2, 2)
+}
+```
+
+##### Code example:
+
+```c#
+using System;
+
+namespace MyNameSpace
+{
+ class MyClass
+ {
+ // Comment here...
+ private int memberProperty = 0;
+ private int memberProperty2 = 1;
+ private int memberProperty3 = 2;
+
+ // Comment here...
+ public string MemberName = "MemberName";
+
+ // Comment here...
+ public static bool IsMemberProperty = false;
+
+ // Comment here...
+ public const int CONSTANT = 1;
+
+ ///
+ /// Comment here...
+ ///
+ public bool IsMember()
+ {
+ return true;
+ }
+
+ ///
+ /// Comment here...
+ ///
+ public void MemberMethod(int value)
+ {
+ int temp = CONSTANT;
+ if (value > 2)
+ {
+ this.memberProperty2 = temp;
+ this.memberProperty3 = temp;
+ }
+ else this.memberProperty3 = value;
+ }
+
+ ///
+ /// Comment here...
+ ///
+ private int MemberMethodEx(int value)
+ {
+ int temp = CONSTANT;
+ this.memberProperty3 = temp;
+ switch (value)
+ {
+ case 1: return 1;
+ case 2:
+ {
+ return -1;
+ }
+ default: return value;
+ }
+ }
+
+ ///
+ /// Comment here...
+ ///
+ private void OnFormActivate(object sender, EventArgs e)
+ {
+ this.MemberMethod(null, null);
+ }
+
+ }
+
+}
+```
+
+##### More generally, be consistent and keep the code clean!
diff --git a/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Docs/index.html b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Docs/index.html
new file mode 100644
index 0000000000..40c76b8a41
--- /dev/null
+++ b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Docs/index.html
@@ -0,0 +1,73 @@
+
+
+
+ HaxeDevelop
+
+
+
+
+
+
+
+
+
+
Description
+
HaxeDevelop is a highly customizable lightweight script editor with extended support for class
+ based languages. Altought the program is designed mostly for Haxe, other languages can
+ be implemented quite easily too. HaxeDevelop requires the Microsoft.NET 4.0 Framework. You can support us by
+ donating for the project via PayPal . Any donation, even 1$, is good for the project. Code contributions are also welcome.
+
You can find more info about HaxeDevelop from the project website haxedevelop.org .
+
+
HaxeDevelop is a custom distribution of FlashDevelop .
+
+
Used Icons
+
Current smooth HaxeDevelop icons are free icons downloaded from
+ famfamfam.com , visualfarm.com and fatcow.com .
+ The icons are released under Creative Commons Attribution 2.5 and 3 Licenses. Some of the used icons are modified from the original ones.
+
+
Used Tools
+
HaxeDevelop includes few third party tools by default. The listed tools are copyright of their respective owners.
+
+
+
Components
+
HaxeDevelop is programmed with C# and it includes misc. modified and unmodified components. DockPanel
+ Suite is used for docking windows and ScintillaNET wrapper is used for providing the Scintilla editor control for C#.
+ The listed components are copyright of their respective owners.
+
+
+
Licence
+
Copyright (c) 2018 Haxe Foundation - HaxeDevelop.org
+
Portions copyright Mika Palmu, Philippe Elsass and all helpful contributors.
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
+ documentation files (the "Software"), to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
+ to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
The above copyright notice and this permission notice shall be included in all copies or portions of the Software.
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
+ TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+
+
+
+
+
diff --git a/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Docs/styles.css b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Docs/styles.css
new file mode 100644
index 0000000000..f858f058a1
--- /dev/null
+++ b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Docs/styles.css
@@ -0,0 +1,65 @@
+body, html
+{
+ font-size:14px;
+ font-family:"Segoe UI", "Trebuchet MS", Georgia, Arial, sans-serif;
+ padding:0;
+ margin:0;
+}
+h4
+{
+ font-size: 24px;
+}
+ul
+{
+ margin: 0px;
+ padding: 0px;
+ margin-left: 3px;
+}
+a
+{
+ color:#257fc2;
+ text-decoration:none;
+}
+
+a:hover
+{
+ color:#257fc2;
+ text-decoration:underline;
+}
+#header
+{
+ width: 100%;
+ text-align:center;
+ background:#257fc2 url('../StartPage/images/pattern.png') center top;
+ margin:0;
+}
+#header h3
+{
+ color: #eea21a;
+}
+#header h3 img
+{
+ margin-right: 5px;
+ margin-bottom: -3px;
+}
+.innerContent
+{
+ padding: 20px;
+}
+#content
+{
+ width: 100%;
+}
+#content ul
+{
+ padding: 5px;
+ padding-bottom: 0px;
+ padding-left: 15px;
+}
+#footer
+{
+ width: 100%;
+ border-top: 1px dotted grey;
+ padding-top: 11px;
+ margin-top: 11px;
+}
diff --git a/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/images/haxedevelop.gif b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/images/haxedevelop.gif
new file mode 100644
index 0000000000..81189df9a9
Binary files /dev/null and b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/images/haxedevelop.gif differ
diff --git a/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/images/pattern.png b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/images/pattern.png
new file mode 100644
index 0000000000..ff5ee01a4f
Binary files /dev/null and b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/images/pattern.png differ
diff --git a/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/index.html b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/index.html
new file mode 100644
index 0000000000..a8c2d25d1c
--- /dev/null
+++ b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/index.html
@@ -0,0 +1,71 @@
+
+
+
+ Start Page
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/javascript/startpage.js b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/javascript/startpage.js
new file mode 100644
index 0000000000..686ad54df1
--- /dev/null
+++ b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/javascript/startpage.js
@@ -0,0 +1,197 @@
+/**
+* Templates used by the start page.
+*/
+var rssFeedItemTemplate = "";
+var projectItemTemplate = "{0} ";
+var tooltipTextTemplate = "{0}" + getLocaleString("tooltipTextType") + " {1}" + getLocaleString("tooltipTextCreated") + " {2}" + getLocaleString("tooltipTextModified") + " {3}";
+var versionAvailableTemplate = "{0}: " + getLocaleString("downloadVersionHere") + " ";
+var versionOutOfDateTemplate = "" + getLocaleString("yourVersionIsOutOfDate") + "
";
+var versionNotAvailableTemplate = "" + getLocaleString("versionInfoNotAvailable") + "
";
+
+/**
+* Parses XML document from string.
+*/
+function parseXmlDocument(xml)
+{
+ var parser = new ActiveXObject("Microsoft.XMLDOM");
+ parser.async = "false";
+ parser.loadXML(xml);
+ return parser;
+}
+
+/**
+* Downloads text document from url.
+*/
+function loadTextDocument(url, callback)
+{
+ var loader = new ActiveXObject("Microsoft.XMLHTTP");
+ loader.onreadystatechange = function()
+ {
+ if (loader.readyState == 4)
+ {
+ callback(loader.responseText, loader.status);
+ }
+ };
+ loader.open("GET", url, true);
+ loader.send(null);
+}
+
+/**
+* Parses the recent project xml document.
+*/
+function handleProjectXml(xml)
+{
+ var html = "";
+ var projects = new Array();
+ var nodes = xml.getElementsByTagName("RecentProject");
+ if (nodes.length === 0) html = getLocaleString("recentProjectsNotFound");
+ for (var i = 0; i < nodes.length; i++)
+ {
+ var name = getNodeText(nodes[i].getElementsByTagName("Name"));
+ var type = getNodeText(nodes[i].getElementsByTagName("Type"));
+ var path = getNodeText(nodes[i].getElementsByTagName("Path")).replace(/\\/g, "\\\\");
+ var created = getNodeText(nodes[i].getElementsByTagName("Created"));
+ var modified = getNodeText(nodes[i].getElementsByTagName("Modified"));
+ var typeDesc = getProjectType(type); // Description of project file type...
+ html += formatString(projectItemTemplate, name, addSlashes(path), typeDesc);
+ }
+ var element = document.getElementById("projectsContent");
+ element.innerHTML = "";
+}
+
+function addSlashes(s)
+{
+ return s.split("'").join("\\'");
+}
+
+/**
+* Parses the rss feed xml document.
+*/
+function handleRssFeedXml(text, status)
+{
+ var html = "";
+ var xml = parseXmlDocument(text);
+ if (status == 200)
+ {
+ var items = new Array();
+ var xmlItems = xml.getElementsByTagName("item");
+ var xmlTitle = getNodeText(xml.getElementsByTagName("title"));
+ document.getElementById("rssTitle").innerHTML = xmlTitle;
+ for (var i = 0; i < xmlItems.length; i++)
+ {
+ var title = getNodeText(xmlItems[i].getElementsByTagName("title"));
+ var link = getNodeText(xmlItems[i].getElementsByTagName("link")).replace(/\\/g, "\\\\");
+ var desc = getNodeText(xmlItems[i].getElementsByTagName("description"));
+ html += formatString(rssFeedItemTemplate, title, link, desc);
+ //if (i != xmlItems.length - 1) html += " ";
+ }
+ }
+ else
+ {
+ html = getLocaleString("rssFeedNotAvailable");
+ }
+ var element = document.getElementById("rssContent");
+ element.innerHTML = html;
+}
+
+/**
+* Safe text extraction
+*/
+function getNodeText(nodes)
+{
+ if (nodes == null) return ""; //"#ERR#1";
+ if (nodes.length == 0) return ""; //"#ERR#2";
+ if (nodes[0].firstChild == null) return ""; //"#ERR#3";
+ return nodes[0].firstChild.nodeValue;
+}
+
+/**
+* Handles the downloaded version info.
+*/
+function handleVersionInfo(text, status)
+{
+ var html = "";
+ if (status == 200)
+ {
+ var info = text.split(/[\r\n]+/g);
+ var version = decodeURIComponent(getUrlParameter("v"));
+ html = formatString(versionAvailableTemplate, info[0], info[1]);
+ if (version && ((info[0] < version) - (version < info[0])) == -1)
+ {
+ html += formatString(versionOutOfDateTemplate, version);
+ }
+ }
+ else html = versionNotAvailableTemplate;
+ var element = document.getElementById("versionContent");
+ element.innerHTML = html;
+}
+
+/**
+* Gets the localized text for the id.
+*/
+function getLocaleString(id)
+{
+ var lang = getUrlParameter("l") || "en_US";
+ return locale[lang + "." + id] || id;
+}
+
+/**
+* Gets the type of the project file.
+*/
+function getProjectType(extension)
+{
+ switch (extension)
+ {
+ case ".fdp" : return getLocaleString("projectTypeFDP");
+ case ".as2proj" : return getLocaleString("projectTypeAS2");
+ case ".as3proj" : return getLocaleString("projectTypeAS3");
+ case ".fdproj" : return getLocaleString("projectTypeGeneric");
+ case ".hxproj" : return getLocaleString("projectTypeHaxe");
+ case ".lsproj" : return getLocaleString("projectTypeLoom");
+ default : return getLocaleString("projectTypeUnknown");
+ }
+}
+
+/**
+* Gets the value of the specified url parameter.
+*/
+function getUrlParameter(id)
+{
+ id = id.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
+ var regex = new RegExp("[?&]" + id + "=([^]*)");
+ var results = regex.exec(unescape(window.location.href));
+ if (results == null) return "";
+ else return results[1];
+}
+
+/**
+* Formats the string with the specified arguments.
+*/
+function formatString(text)
+{
+ var result = text;
+ for (var i = 1; i < arguments.length; i++)
+ {
+ var pattern = "{" + (i - 1) + "}";
+ while (result.indexOf(pattern) >= 0)
+ {
+ result = result.replace(pattern, arguments[i]);
+ }
+ }
+ return result;
+}
+
+/**
+* Handles the data sent by FlashDevelop.
+*/
+function handleXmlData(projectXml, rssUrl)
+{
+ if (rssUrl != null)
+ {
+ var hdUrl = "https://haxedevelop.org/latest.txt";
+ loadTextDocument(hdUrl, handleVersionInfo);
+ loadTextDocument(rssUrl, handleRssFeedXml);
+ }
+ var xml = parseXmlDocument(projectXml);
+ handleProjectXml(xml);
+}
diff --git a/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/styles.css b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/styles.css
new file mode 100644
index 0000000000..290883eea3
--- /dev/null
+++ b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/StartPage/styles.css
@@ -0,0 +1,239 @@
+html,body
+{
+ width:100%;
+ height:100%;
+}
+
+body
+{
+ background:#257fc2 url(images/pattern.png) center top;
+ font-size:14px;
+ font-family:"Segoe UI", "Trebuchet MS", Georgia, Arial, sans-serif;
+ color:#fff;
+ box-shadow:inset 0 0 50px rgba(0,0,0,0.35);
+ margin:0;
+ padding:0;
+}
+
+.clearfix:after {
+ visibility: hidden;
+ display: block;
+ font-size: 0;
+ content: " ";
+ clear: both;
+ height: 0;
+}
+
+* html .clearfix { zoom: 1; } /* IE6 */
+*:first-child+html .clearfix { zoom: 1; } /* IE7 */
+
+h1,h2,h3
+{
+ border-bottom:1px dashed rgba(255,255,255,.5);
+ font-weight:400;
+ padding:10px;
+ margin:0 0 0 0;
+}
+
+#header
+{
+ text-align:center;
+}
+
+#links
+{
+ background:#333;
+ padding:10px;
+ text-align:right;
+}
+
+#links a
+{
+ color:#fff;
+ font:normal 14px "Segoe UI", arial, sans-serif;
+ margin-right:5px;
+}
+
+#news
+{
+ background:#fbfbfb;
+ color:#333;
+}
+
+.button
+{
+ font-size:14px;
+ display:inline-block;
+ margin-right:5px;
+ margin-bottom:5px;
+ border-radius:3px;
+ text-decoration:none;
+ padding:7px 7px;
+}
+#projects .button {
+ width:48%;
+}
+
+#version .button {
+ width:99%;
+}
+
+img,a img
+{
+ border:none;
+ outline:none;
+}
+
+a
+{
+ color:#ff9;
+ text-decoration:none;
+ display:inline-block;
+}
+
+a:hover
+{
+ color:#ee6;
+ text-decoration:underline;
+}
+
+div#tooltip
+{
+ top:0;
+ left:0;
+ z-index:2;
+ visibility:hidden;
+ position:absolute;
+ background-color:#333;
+ border:1px solid #999;
+ padding:4px 7px 3px;
+ color:#fff;
+ font-size:14px;
+}
+
+table#holder
+{
+ text-align:left;
+ position:absolute;
+ width:100%;
+ top:115px;
+ padding:1px;
+}
+
+td.holderSpacer
+{
+ width:15px;
+}
+
+td.smallWindowHolder
+{
+ width:280px;
+}
+
+div#tasksContent
+{
+ padding-bottom:10px;
+ padding-left:5px;
+}
+
+#projectsContent li
+{
+ background:#257fc2 url(images/iconProject.gif) no-repeat 9px center;
+ display:block;
+ padding: 5px 5px 5px 32px;
+ margin-bottom:2px;
+ border:1px solid #7db3db;
+ border-radius:3px;
+ cursor:pointer;
+}
+#projectsContent li:hover {
+ background-color:#333;
+ border:1px solid #b2d1e8;
+}
+
+#rssContent li
+{
+ margin:0;
+ padding:0;
+}
+
+.rssItemTitle
+{
+ display:block;
+}
+
+.rssItemContent
+{
+ color:#111;
+}
+
+.rssItemContent a
+{
+ font-weight:700;
+}
+
+#rssContent a
+{
+ color:#257fc2;
+ text-decoration:none;
+}
+
+#rssContent a:hover
+{
+ color:#257fc2;
+ text-decoration:underline;
+}
+
+
+#social a:hover img
+{
+ opacity:.8;
+}
+
+.greyedOut
+{
+ color:#ccc;
+}
+
+.alertRed
+{
+ color:red;
+}
+
+.section-gray
+{
+ background:#141419;
+ background:#257fc2 url(images/pattern.png) center top;
+}
+
+#header
+{
+ width:33%;
+}
+
+#projects
+{
+ width:33%;
+}
+
+#projectslist
+{
+ width:33%;
+}
+
+#projectslist, #projects, #header
+{
+ float:left;
+}
+
+.innerContent
+{
+ padding:20px 10px 20px 20px;
+}
+
+div#projectsContent ul,li,div#rssContent ul,li
+{
+ list-style-type:none;
+ margin:0;
+ padding:0;
+}
\ No newline at end of file
diff --git a/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Tools/appman/Config.xml b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Tools/appman/Config.xml
new file mode 100644
index 0000000000..d21e43be5f
--- /dev/null
+++ b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Tools/appman/Config.xml
@@ -0,0 +1,19 @@
+
+
+
+ HaxeDevelop
+
+ FD5,HD5,Haxelib
+
+ $(BaseDir)\Apps
+
+ http://www.flashdevelop.org/appman.xml
+
+ http://www.flashdevelop.org/wikidocs/
+
+ $(BaseDir)
+
+ $(BaseDir)\Data\AppMan
+
+ en_US
+
\ No newline at end of file
diff --git a/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Tools/winres/winres.exe b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Tools/winres/winres.exe
new file mode 100755
index 0000000000..21f3476540
Binary files /dev/null and b/Distros/HaxeDevelop/FlashDevelop/Bin/Debug/Tools/winres/winres.exe differ
diff --git a/Distros/HaxeDevelop/FlashDevelop/Installer/Config.nsh b/Distros/HaxeDevelop/FlashDevelop/Installer/Config.nsh
new file mode 100644
index 0000000000..2f2f8b634e
--- /dev/null
+++ b/Distros/HaxeDevelop/FlashDevelop/Installer/Config.nsh
@@ -0,0 +1,7 @@
+; Define distro config
+!define DIST_NAME "HaxeDevelop"
+!define DIST_COMP "HaxeDevelop.org"
+!define DIST_COPY "HaxeDevelop.org 2005-2018"
+!define DIST_README "http://haxedevelop.org"
+!define DIST_COMMUNITY "https://haxedevelop.org/blog/"
+!define DIST_DOCS "https://haxedevelop.org";
diff --git a/Distros/HaxeDevelop/FlashDevelop/Installer/Graphics/Banner.bmp b/Distros/HaxeDevelop/FlashDevelop/Installer/Graphics/Banner.bmp
new file mode 100644
index 0000000000..9c56ddcbb2
Binary files /dev/null and b/Distros/HaxeDevelop/FlashDevelop/Installer/Graphics/Banner.bmp differ
diff --git a/Distros/HaxeDevelop/FlashDevelop/Installer/Graphics/Wizard.bmp b/Distros/HaxeDevelop/FlashDevelop/Installer/Graphics/Wizard.bmp
new file mode 100644
index 0000000000..1c0bb2dd15
Binary files /dev/null and b/Distros/HaxeDevelop/FlashDevelop/Installer/Graphics/Wizard.bmp differ
diff --git a/Distros/HaxeDevelop/FlashDevelop/Resources/AboutDialog.jpg b/Distros/HaxeDevelop/FlashDevelop/Resources/AboutDialog.jpg
new file mode 100644
index 0000000000..04ed513e42
Binary files /dev/null and b/Distros/HaxeDevelop/FlashDevelop/Resources/AboutDialog.jpg differ
diff --git a/Distros/HaxeDevelop/FlashDevelop/Resources/FlashDevelopIcon.ico b/Distros/HaxeDevelop/FlashDevelop/Resources/FlashDevelopIcon.ico
new file mode 100644
index 0000000000..d019c1e5c8
Binary files /dev/null and b/Distros/HaxeDevelop/FlashDevelop/Resources/FlashDevelopIcon.ico differ
diff --git a/Distros/HaxeDevelop/PluginCore/PluginCore/DistroConfig.cs b/Distros/HaxeDevelop/PluginCore/PluginCore/DistroConfig.cs
new file mode 100644
index 0000000000..5cd871dd5e
--- /dev/null
+++ b/Distros/HaxeDevelop/PluginCore/PluginCore/DistroConfig.cs
@@ -0,0 +1,20 @@
+using System;
+
+namespace PluginCore
+{
+ public class DistroConfig
+ {
+ public const string DISTRIBUTION_NAME = "HaxeDevelop";
+ public const string DISTRIBUTION_DESC = "HaxeDevelop is an open source script editor.";
+ public const string DISTRIBUTION_HOME = "https://haxedevelop.org/";
+ public const string DISTRIBUTION_HELP = "https://haxedevelop.org/system-requirements.html";
+ public const string DISTRIBUTION_VERSION = "https://haxedevelop.org/latest.txt";
+ public const string DISTRIBUTION_ABOUT = "HaxeDevelop logo, domain and the name are copyright of Haxe Foundation.\r\nHaxeDevelop is a custom distribution of FlashDevelop.\r\nDevelopment: Mika Palmu, Philippe Elsass and all helpful contributors.";
+ public const string DISTRIBUTION_COPYRIGHT = "HaxeDevelop.org 2015-2020";
+ public const string DISTRIBUTION_COMPANY = "HaxeDevelop.org";
+ public const string DISTRIBUTION_RSS = "https://haxedevelop.org/rss.xml";
+ public const string DISTRIBUTION_EXT = "hx";
+ public const string DISTRIBUTION_DEV_VERSION = "https://flashdevelop.org/downloads/builds/HaxeDevelop-development.txt";
+ public const string DISTRIBUTION_DEV_BUILD = "https://flashdevelop.org/downloads/builds/HaxeDevelop-development.exe";
+ }
+}
\ No newline at end of file
diff --git a/Distros/README.md b/Distros/README.md
new file mode 100644
index 0000000000..5287a78ecd
--- /dev/null
+++ b/Distros/README.md
@@ -0,0 +1,7 @@
+# FlashDevelop distros
+
+## Haxedevelop
+
+HaxeDevelop a custom distribution of FlashDevelop where editor configuration is focussed on [Haxe](https://haxe.org/).
+
+* More info:
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Aga.Controls.csproj b/External/3rdParty/Aga-1.7/Aga.Controls/Aga.Controls.csproj
index 614dde903c..de5b13bbf6 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Aga.Controls.csproj
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Aga.Controls.csproj
@@ -1,10 +1,8 @@
-
+
Debug
AnyCPU
- 9.0.21022
- 2.0
{E73BB233-D88B-44A7-A98F-D71EE158381D}
Library
Properties
@@ -22,25 +20,14 @@
key.snk
- 3.5
- v2.0
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
+ net48
+ true
+ false
+ false
+ false
+
true
@@ -104,6 +91,9 @@
+
+
+
@@ -238,7 +228,6 @@
TreeViewAdv.cs
- Designer
@@ -250,29 +239,4 @@
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- true
-
-
- False
- Windows Installer 3.1
- true
-
-
-
-
\ No newline at end of file
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Properties/AssemblyInfo.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Properties/AssemblyInfo.cs
index 34f94db926..d7205aee26 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Properties/AssemblyInfo.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Properties/AssemblyInfo.cs
@@ -12,4 +12,4 @@
[assembly: AssemblyCopyright("Copyright © Andrey Gliznetsov 2006 - 2009")]
[assembly: AssemblyDescription("http://sourceforge.net/projects/treeviewadv/")]
-[assembly: AssemblyVersion("1.7.0.0")]
+[assembly: AssemblyVersion("1.7.0.1")]
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Properties/Resources.Designer.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Properties/Resources.Designer.cs
index 1968ffbfbf..cbfdbd0b10 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Properties/Resources.Designer.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Properties/Resources.Designer.cs
@@ -1,7 +1,7 @@
//------------------------------------------------------------------------------
//
// This code was generated by a tool.
-// Runtime Version:4.0.30319.296
+// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
@@ -60,6 +60,9 @@ internal Resources() {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
internal static System.Drawing.Bitmap check {
get {
object obj = ResourceManager.GetObject("check", resourceCulture);
@@ -67,6 +70,9 @@ internal static System.Drawing.Bitmap check {
}
}
+ ///
+ /// Looks up a localized resource of type System.Byte[].
+ ///
internal static byte[] DVSplit {
get {
object obj = ResourceManager.GetObject("DVSplit", resourceCulture);
@@ -74,6 +80,9 @@ internal static byte[] DVSplit {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
internal static System.Drawing.Bitmap Folder {
get {
object obj = ResourceManager.GetObject("Folder", resourceCulture);
@@ -81,6 +90,9 @@ internal static System.Drawing.Bitmap Folder {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
internal static System.Drawing.Bitmap FolderClosed {
get {
object obj = ResourceManager.GetObject("FolderClosed", resourceCulture);
@@ -88,6 +100,9 @@ internal static System.Drawing.Bitmap FolderClosed {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
internal static System.Drawing.Bitmap Leaf {
get {
object obj = ResourceManager.GetObject("Leaf", resourceCulture);
@@ -95,6 +110,9 @@ internal static System.Drawing.Bitmap Leaf {
}
}
+ ///
+ /// Looks up a localized resource of type System.Byte[].
+ ///
internal static byte[] loading_icon {
get {
object obj = ResourceManager.GetObject("loading_icon", resourceCulture);
@@ -102,6 +120,9 @@ internal static byte[] loading_icon {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
internal static System.Drawing.Bitmap minus {
get {
object obj = ResourceManager.GetObject("minus", resourceCulture);
@@ -109,6 +130,9 @@ internal static System.Drawing.Bitmap minus {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
internal static System.Drawing.Bitmap plus {
get {
object obj = ResourceManager.GetObject("plus", resourceCulture);
@@ -116,6 +140,9 @@ internal static System.Drawing.Bitmap plus {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
internal static System.Drawing.Bitmap uncheck {
get {
object obj = ResourceManager.GetObject("uncheck", resourceCulture);
@@ -123,6 +150,9 @@ internal static System.Drawing.Bitmap uncheck {
}
}
+ ///
+ /// Looks up a localized resource of type System.Drawing.Bitmap.
+ ///
internal static System.Drawing.Bitmap unknown {
get {
object obj = ResourceManager.GetObject("unknown", resourceCulture);
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Threading/AbortableThreadPool.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Threading/AbortableThreadPool.cs
index 5424e8974d..24a77c7e10 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Threading/AbortableThreadPool.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Threading/AbortableThreadPool.cs
@@ -111,6 +111,7 @@ public void CancelAll(bool allowAbort)
{
foreach (Thread t in _threads.Values)
t.Abort();
+ _threads.Clear();
}
}
}
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/AutoHeaderHeightLayout.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/AutoHeaderHeightLayout.cs
new file mode 100644
index 0000000000..0cebc0c831
--- /dev/null
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/AutoHeaderHeightLayout.cs
@@ -0,0 +1,64 @@
+using System;
+using System.ComponentModel;
+using System.Windows.Forms;
+
+namespace Aga.Controls.Tree
+{
+ using System.Drawing;
+
+ public class AutoHeaderHeightLayout : IHeaderLayout
+ {
+ DrawContext _measureContext;
+ TreeViewAdv _treeView;
+
+ public AutoHeaderHeightLayout(TreeViewAdv treeView, int headerHeight)
+ {
+ _treeView = treeView;
+ PreferredHeaderHeight = headerHeight;
+ _measureContext = new DrawContext();
+ _measureContext.Graphics = Graphics.FromImage(new Bitmap(1, 1));
+ }
+
+ int? _headerHeight;
+
+ bool _computed;
+
+ #region Implementation of IHeaderLayout
+
+ public int PreferredHeaderHeight
+ {
+ get { return GetHeaderHeight(); }
+ set
+ {
+ _headerHeight = value;
+ _computed = false;
+ }
+ }
+
+ public void ClearCache()
+ {
+ _computed = false;
+ }
+
+ int GetHeaderHeight()
+ {
+ if (!_computed)
+ {
+ int res = 0;
+ _measureContext.Font = _treeView.Font;
+ foreach (TreeColumn nc in _treeView.Columns)
+ {
+ int h = nc.GetActualSize(_measureContext).Height;
+ if (h > res) res = h;
+ }
+ _headerHeight = res;
+
+ _computed = true;
+ }
+
+ return _headerHeight.Value;
+ }
+
+ #endregion
+ }
+}
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/AutoRowHeightLayout.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/AutoRowHeightLayout.cs
index 953df024e4..8b8d7e4cdc 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/AutoRowHeightLayout.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/AutoRowHeightLayout.cs
@@ -37,7 +37,7 @@ public int PageRowCount
return 0;
else
{
- int pageHeight = _treeView.DisplayRectangle.Height - _treeView.ColumnHeaderHeight;
+ int pageHeight = _treeView.DisplayRectangle.Height - _treeView.ActualColumnHeaderHeight;
int y = 0;
for (int i = _treeView.RowCount - 1; i >= 0; i--)
{
@@ -58,7 +58,7 @@ public int CurrentPageSize
return 0;
else
{
- int pageHeight = _treeView.DisplayRectangle.Height - _treeView.ColumnHeaderHeight;
+ int pageHeight = _treeView.DisplayRectangle.Height - _treeView.ActualColumnHeaderHeight;
int y = 0;
for (int i = _treeView.FirstVisibleRow; i < _treeView.RowCount; i++)
{
@@ -117,7 +117,7 @@ private int GetRowHeight(int rowNo)
public int GetRowAt(Point point)
{
- int py = point.Y - _treeView.ColumnHeaderHeight;
+ int py = point.Y - _treeView.ActualColumnHeaderHeight;
int y = 0;
for (int i = _treeView.FirstVisibleRow; i < _treeView.RowCount; i++)
{
@@ -132,7 +132,7 @@ public int GetRowAt(Point point)
public int GetFirstRow(int lastPageRow)
{
- int pageHeight = _treeView.DisplayRectangle.Height - _treeView.ColumnHeaderHeight;
+ int pageHeight = _treeView.DisplayRectangle.Height - _treeView.ActualColumnHeaderHeight;
int y = 0;
for (int i = lastPageRow; i >= 0; i--)
{
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Enums.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Enums.cs
index 3a83e9a7cf..abf52168af 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Enums.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Enums.cs
@@ -4,6 +4,12 @@
namespace Aga.Controls.Tree
{
+
+ public enum BackgroundPaintMode
+ {
+ Default,Gradiant
+ }
+
public enum DrawSelectionMode
{
None, Active, Inactive, FullRowSelect
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/FixedHeaderHeightLayout.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/FixedHeaderHeightLayout.cs
new file mode 100644
index 0000000000..6f557d852d
--- /dev/null
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/FixedHeaderHeightLayout.cs
@@ -0,0 +1,28 @@
+namespace Aga.Controls.Tree
+{
+ class FixedHeaderHeightLayout : IHeaderLayout
+ {
+ TreeViewAdv _treeView;
+ int _headerHeight;
+
+ public FixedHeaderHeightLayout(TreeViewAdv treeView, int headerHeight)
+ {
+ _treeView = treeView;
+ PreferredHeaderHeight = headerHeight;
+ }
+
+ #region Implementation of IHeaderLayout
+
+ public int PreferredHeaderHeight
+ {
+ get { return _headerHeight; }
+ set { _headerHeight = value; }
+ }
+
+ public void ClearCache()
+ {
+ }
+
+ #endregion
+ }
+}
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/FixedRowHeightLayout.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/FixedRowHeightLayout.cs
index 316b3dc7d5..3fdc399564 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/FixedRowHeightLayout.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/FixedRowHeightLayout.cs
@@ -31,7 +31,7 @@ public int PageRowCount
{
get
{
- return Math.Max((_treeView.DisplayRectangle.Height - _treeView.ColumnHeaderHeight) / _rowHeight, 0);
+ return Math.Max((_treeView.DisplayRectangle.Height - _treeView.ActualColumnHeaderHeight) / _rowHeight, 0);
}
}
@@ -45,7 +45,7 @@ public int CurrentPageSize
public int GetRowAt(Point point)
{
- point = new Point(point.X, point.Y + (_treeView.FirstVisibleRow * _rowHeight) - _treeView.ColumnHeaderHeight);
+ point = new Point(point.X, point.Y + (_treeView.FirstVisibleRow * _rowHeight) - _treeView.ActualColumnHeaderHeight);
return point.Y / _rowHeight;
}
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/IHeaderLayout.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/IHeaderLayout.cs
new file mode 100644
index 0000000000..9289762d3c
--- /dev/null
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/IHeaderLayout.cs
@@ -0,0 +1,13 @@
+namespace Aga.Controls.Tree
+{
+ internal interface IHeaderLayout
+ {
+ int PreferredHeaderHeight
+ {
+ get;
+ set;
+ }
+
+ void ClearCache();
+ }
+}
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Input/ReorderColumnState.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Input/ReorderColumnState.cs
index 181cca51b3..0fc3bd2743 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Input/ReorderColumnState.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Input/ReorderColumnState.cs
@@ -41,7 +41,7 @@ public ReorderColumnState(TreeViewAdv tree, TreeColumn column, Point initialMous
{
_location = new Point(initialMouseLocation.X + Tree.OffsetX, 0);
_dragOffset = tree.GetColumnX(column) - initialMouseLocation.X;
- _ghostImage = column.CreateGhostImage(new Rectangle(0, 0, column.Width, tree.ColumnHeaderHeight), tree.Font);
+ _ghostImage = column.CreateGhostImage(new Rectangle(0, 0, column.Width, tree.ActualColumnHeaderHeight), tree.Font, tree.ForeColor);
}
public override void KeyDown(KeyEventArgs args)
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Input/ResizeColumnState.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Input/ResizeColumnState.cs
index e4d8653f60..87ad05b555 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Input/ResizeColumnState.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/Input/ResizeColumnState.cs
@@ -40,6 +40,7 @@ private void FinishResize()
Tree.ChangeInput();
Tree.FullUpdate();
Tree.OnColumnWidthChanged(Column);
+ Tree.OnColumnHeightChanged(Column);
}
public override bool MouseMove(MouseEventArgs args)
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/BaseTextControl.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/BaseTextControl.cs
index cbe36a2ad7..d94a74e561 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/BaseTextControl.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/BaseTextControl.cs
@@ -128,7 +128,7 @@ protected Size GetLabelSize(TreeNodeAdv node, DrawContext context, string label)
CheckThread();
Font font = GetDrawingFont(node, context, label);
Size s = Size.Empty;
- if (UseCompatibleTextRendering)
+ if (!UseCompatibleTextRendering)
s = TextRenderer.MeasureText(label, font);
else
{
@@ -170,18 +170,16 @@ public override void Draw(TreeNodeAdv node, DrawContext context)
return;
PerformanceAnalyzer.Start("BaseTextControl.Draw");
- string label = GetLabel(node);
+
Rectangle bounds = GetBounds(node, context);
Rectangle focusRect = new Rectangle(bounds.X, context.Bounds.Y,
bounds.Width, context.Bounds.Height);
+
+ DrawEventArgs args;
+ CreateBrushes(node, context, out args);
- Brush backgroundBrush;
- Color textColor;
- Font font;
- CreateBrushes(node, context, label, out backgroundBrush, out textColor, out font, ref label);
-
- if (backgroundBrush != null)
- context.Graphics.FillRectangle(backgroundBrush, focusRect);
+ if (args.BackgroundBrush != null)
+ context.Graphics.FillRectangle(args.BackgroundBrush, focusRect);
if (context.DrawFocus)
{
focusRect.Width--;
@@ -194,15 +192,50 @@ public override void Draw(TreeNodeAdv node, DrawContext context)
}
PerformanceAnalyzer.Start("BaseTextControl.DrawText");
- if (UseCompatibleTextRendering)
- TextRenderer.DrawText(context.Graphics, label, font, bounds, textColor, _formatFlags);
- else
- context.Graphics.DrawString(label, font, GetFrush(textColor), bounds, _format);
- PerformanceAnalyzer.Finish("BaseTextControl.DrawText");
+
+ DrawHighLight(context, bounds, args);
+
+ if (!UseCompatibleTextRendering)
+ TextRenderer.DrawText(context.Graphics, args.Text, args.Font, bounds, args.TextColor, _formatFlags);
+ else
+ context.Graphics.DrawString(args.Text, args.Font, GetFrush(args.TextColor), bounds, _format);
+
+ PerformanceAnalyzer.Finish("BaseTextControl.DrawText");
PerformanceAnalyzer.Finish("BaseTextControl.Draw");
}
+ private void DrawHighLight(DrawContext context, Rectangle bounds, DrawEventArgs args)
+ {
+ string label = args.Text;
+ if (!String.IsNullOrEmpty(args.HighLightToken) && label.ToLower().Contains(args.HighLightToken.ToLower()))
+ {
+ Graphics g = context.Graphics;
+ int numChars = label.Length;
+ CharacterRange[] characterRanges = new CharacterRange[1];
+ int idx = label.ToLower().IndexOf(args.HighLightToken.ToLower());
+ //Get the max width.. for the complete length
+ SizeF size = g.MeasureString(label, args.Font);
+
+ //Assume the string is in a stratight line, just to work out the
+ //regions. We will adjust the containing rectangles later.
+ RectangleF layoutRect =
+ new RectangleF(0.0f, 0.0f, size.Width, size.Height);
+
+ //
+ // Set up the array to accept the regions.
+ Region[] stringRegions = new Region[numChars];
+ for (int i = 0; i < 1; i++)
+ characterRanges[i] = new CharacterRange(idx, args.HighLightToken.Length);
+
+ _format.SetMeasurableCharacterRanges(characterRanges);
+
+ stringRegions = context.Graphics.MeasureCharacterRanges(label, args.Font, bounds, _format);
+ RectangleF highLightedBounds = stringRegions[0].GetBounds(g);
+ g.FillRectangle(GetFrush(args.HighLightColor), Rectangle.Round(highLightedBounds));
+ }
+ }
+
private static Dictionary _brushes = new Dictionary();
private static Brush GetFrush(Color color)
{
@@ -217,42 +250,30 @@ private static Brush GetFrush(Color color)
return br;
}
- private void CreateBrushes(TreeNodeAdv node, DrawContext context, string text, out Brush backgroundBrush, out Color textColor, out Font font, ref string label)
+ private void CreateBrushes(TreeNodeAdv node, DrawContext context, out DrawEventArgs args)
{
- textColor = SystemColors.ControlText;
- backgroundBrush = null;
- font = context.Font;
+ args = new DrawEventArgs(node, this, context, GetLabel(node));
+ args.TextColor = SystemColors.ControlText;
+ args.BackgroundBrush = null;
+ args.Font = context.Font;
if (context.DrawSelection == DrawSelectionMode.Active)
{
- textColor = SystemColors.HighlightText;
- backgroundBrush = SystemBrushes.Highlight;
+ args.TextColor = SystemColors.HighlightText;
+ args.BackgroundBrush = Parent._highlightColorActiveBrush;
}
else if (context.DrawSelection == DrawSelectionMode.Inactive)
{
- textColor = SystemColors.ControlText;
- backgroundBrush = SystemBrushes.InactiveBorder;
+ args.TextColor = SystemColors.ControlText;
+ args.BackgroundBrush = Parent._highlightColorInactiveBrush;
}
else if (context.DrawSelection == DrawSelectionMode.FullRowSelect)
- textColor = SystemColors.HighlightText;
+ args.TextColor = SystemColors.HighlightText;
if (!context.Enabled)
- textColor = SystemColors.GrayText;
+ args.TextColor = SystemColors.GrayText;
if (DrawTextMustBeFired(node))
- {
- DrawEventArgs args = new DrawEventArgs(node, this, context, text);
- args.Text = label;
- args.TextColor = textColor;
- args.BackgroundBrush = backgroundBrush;
- args.Font = font;
-
- OnDrawText(args);
-
- textColor = args.TextColor;
- backgroundBrush = args.BackgroundBrush;
- font = args.Font;
- label = args.Text;
- }
+ OnDrawText(args);
}
public string GetLabel(TreeNodeAdv node)
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/DrawEventArgs.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/DrawEventArgs.cs
index 8333c1f24c..a54788f551 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/DrawEventArgs.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/DrawEventArgs.cs
@@ -56,6 +56,22 @@ public EditableControl Control
get { return _control; }
}
+ private string _highLightToken;
+
+ public string HighLightToken
+ {
+ get { return _highLightToken; }
+ set { _highLightToken = value; }
+ }
+
+ private Color _highLightColor = Color.Yellow;
+ public Color HighLightColor
+ {
+ get { return _highLightColor; }
+ set { _highLightColor = value; }
+ }
+
+
public DrawEventArgs(TreeNodeAdv node, EditableControl control, DrawContext context, string text)
: base(node)
{
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/ExpandingIcon.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/ExpandingIcon.cs
index bd2c34cd2e..fecc124aef 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/ExpandingIcon.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/ExpandingIcon.cs
@@ -64,10 +64,13 @@ private static void IterateIcons()
{
while (_animatingThread != null)
{
- if (_index < _gif.FrameCount - 1)
- _index++;
- else
- _index = 0;
+ lock (_lock)
+ {
+ if (_index < _gif.FrameCount - 1)
+ _index++;
+ else
+ _index = 0;
+ }
if (IconChanged != null)
IconChanged(null, EventArgs.Empty);
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/NodeCheckBox.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/NodeCheckBox.cs
index d0aec6459d..de4c1ebe1c 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/NodeCheckBox.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/NodeCheckBox.cs
@@ -1,9 +1,6 @@
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Drawing;
using Aga.Controls.Properties;
-using System.Reflection;
using System.Windows.Forms;
using System.Windows.Forms.VisualStyles;
using System.ComponentModel;
@@ -28,6 +25,18 @@ public bool ThreeState
set { _threeState = value; }
}
+ bool _reverseCheckOrder;
+ ///
+ /// Reverses the Order.
+ /// From Indeterminate, Unchecked, Checked to Indeterminate, Checked, Unchecked.
+ ///
+ [DefaultValue(false)]
+ public bool ReverseCheckOrder
+ {
+ get { return _reverseCheckOrder; }
+ set { _reverseCheckOrder = value; }
+ }
+
#endregion
public NodeCheckBox()
@@ -134,14 +143,26 @@ public override void MouseDoubleClick(TreeNodeAdvMouseEventArgs args)
args.Handled = true;
}
- private CheckState GetNewState(CheckState state)
+ protected virtual CheckState GetNewState(CheckState state)
{
- if (state == CheckState.Indeterminate)
- return CheckState.Unchecked;
- else if(state == CheckState.Unchecked)
- return CheckState.Checked;
- else
- return ThreeState ? CheckState.Indeterminate : CheckState.Unchecked;
+ if (ReverseCheckOrder)
+ {
+ if (state == CheckState.Indeterminate)
+ return CheckState.Checked;
+ else if (state == CheckState.Checked)
+ return CheckState.Unchecked;
+ else
+ return ThreeState ? CheckState.Indeterminate : CheckState.Checked;
+ }
+ else
+ {
+ if (state == CheckState.Indeterminate)
+ return CheckState.Unchecked;
+ else if (state == CheckState.Unchecked)
+ return CheckState.Checked;
+ else
+ return ThreeState ? CheckState.Indeterminate : CheckState.Unchecked;
+ }
}
public override void KeyDown(KeyEventArgs args)
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/NodeTextBox.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/NodeTextBox.cs
index 81065d8ee0..5a1ebf867d 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/NodeTextBox.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/NodeControls/NodeTextBox.cs
@@ -47,9 +47,21 @@ protected override Control CreateEditor(TreeNodeAdv node)
textBox.KeyDown += EditorKeyDown;
_label = textBox.Text;
SetEditControlProperties(textBox, node);
+ textBox.PreviewKeyDown += new PreviewKeyDownEventHandler(textBox_PreviewKeyDown);
return textBox;
}
+ void textBox_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
+ {
+ switch (e.KeyCode)
+ {
+ case Keys.Enter:
+ case Keys.Escape:
+ e.IsInputKey = true;
+ break;
+ }
+ }
+
protected virtual TextBox CreateTextBox()
{
return new TextBox();
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeColumn.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeColumn.cs
index fcaf03d63e..713b5e4d38 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeColumn.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeColumn.cs
@@ -27,6 +27,8 @@ public override bool GetPropertiesSupported(ITypeDescriptorContext context)
private const int HeaderLeftMargin = 5;
private const int HeaderRightMargin = 5;
+ private const int HeaderTopMargin = 3;
+ private const int HeaderBottomMargin = 3;
private const int SortOrderMarkMargin = 8;
private TextFormatFlags _headerFlags;
@@ -215,6 +217,61 @@ protected override void Dispose(bool disposing)
base.Dispose(disposing);
}
+ internal Size GetActualSize(DrawContext context)
+ {
+ if (IsVisible)
+ {
+ Size s = MeasureSize(context);
+ return new Size(s.Width + HeaderLeftMargin, HeaderTopMargin + s.Height + HeaderBottomMargin);
+ }
+ return Size.Empty;
+ }
+
+ public Size MeasureSize(DrawContext context)
+ {
+ return GetLabelSize(context);
+ }
+
+ protected Size GetLabelSize(DrawContext context)
+ {
+ return GetLabelSize(context, Header);
+ }
+
+ protected Size GetLabelSize(DrawContext context, string label)
+ {
+ PerformanceAnalyzer.Start("GetLabelSize");
+
+ Font font = GetDrawingFont(context, label);
+ Size s = Size.Empty;
+ if (!UseCompatibleTextRendering)
+ s = TextRenderer.MeasureText(label, font);
+ else
+ {
+ SizeF sf = context.Graphics.MeasureString(label, font);
+ s = new Size((int)Math.Ceiling(sf.Width), (int)Math.Ceiling(sf.Height));
+ }
+
+ PerformanceAnalyzer.Finish("GetLabelSize");
+
+ if (!s.IsEmpty)
+ return s;
+ else
+ return new Size(10, font.Height);
+ }
+
+ protected Font GetDrawingFont(DrawContext context, string label)
+ {
+ return context.Font;
+ }
+
+ private bool _useCompatibleTextRendering = false;
+ [DefaultValue(false)]
+ public bool UseCompatibleTextRendering
+ {
+ get { return _useCompatibleTextRendering; }
+ set { _useCompatibleTextRendering = value; }
+ }
+
#region Draw
private static VisualStyleRenderer _normalRenderer;
@@ -231,23 +288,22 @@ private static void CreateRenderers()
}
}
- internal Bitmap CreateGhostImage(Rectangle bounds, Font font)
+ internal Bitmap CreateGhostImage(Rectangle bounds, Font font, Color color)
{
Bitmap b = new Bitmap(bounds.Width, bounds.Height, PixelFormat.Format32bppArgb);
Graphics gr = Graphics.FromImage(b);
gr.FillRectangle(SystemBrushes.ControlDark, bounds);
- DrawContent(gr, bounds, font);
+ DrawContent(gr, bounds, font, color);
BitmapHelper.SetAlphaChanelValue(b, 150);
return b;
}
- internal void Draw(Graphics gr, Rectangle bounds, Font font, bool pressed, bool hot)
+ internal void Draw(Graphics gr, Rectangle bounds, Font font, bool pressed, bool hot, Color color)
{
- DrawBackground(gr, bounds, pressed, hot);
- DrawContent(gr, bounds, font);
+ DrawContent(gr, bounds, font, color);
}
- private void DrawContent(Graphics gr, Rectangle bounds, Font font)
+ private void DrawContent(Graphics gr, Rectangle bounds, Font font, Color color)
{
Rectangle innerBounds = new Rectangle(bounds.X + HeaderLeftMargin, bounds.Y,
bounds.Width - HeaderLeftMargin - HeaderRightMargin,
@@ -274,9 +330,9 @@ private void DrawContent(Graphics gr, Rectangle bounds, Font font)
}
if (textSize.Width < maxTextSize.Width)
- TextRenderer.DrawText(gr, Header, font, innerBounds, SystemColors.ControlText, _baseHeaderFlags | TextFormatFlags.Left);
+ TextRenderer.DrawText(gr, Header, font, innerBounds, color, _baseHeaderFlags | TextFormatFlags.Left);
else
- TextRenderer.DrawText(gr, Header, font, innerBounds, SystemColors.ControlText, _headerFlags);
+ TextRenderer.DrawText(gr, Header, font, innerBounds, color, _headerFlags);
}
private void DrawSortMark(Graphics gr, Rectangle bounds, int x)
@@ -334,11 +390,20 @@ internal static void DrawBackground(Graphics gr, Rectangle bounds, bool pressed,
}
}
- #endregion
+ internal static void DrawCustomBackground(Graphics gr, Color back, Color fore, Rectangle bounds, bool pressed, bool hot)
+ {
+ gr.FillRectangle(new SolidBrush(back), bounds);
+ Pen p1 = new Pen(fore);
+ gr.DrawLine(p1, bounds.X, bounds.Y - 1, bounds.Right, bounds.Y - 1);
+ gr.DrawLine(p1, bounds.Right - 1, bounds.Y + 3, bounds.Right - 1, bounds.Bottom - 4);
+ gr.DrawLine(p1, bounds.X, bounds.Bottom, bounds.Right, bounds.Bottom);
+ }
+
+ #endregion
- #region Events
+ #region Events
- public event EventHandler HeaderChanged;
+ public event EventHandler HeaderChanged;
private void OnHeaderChanged()
{
if (HeaderChanged != null)
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeColumnCollection.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeColumnCollection.cs
index 2368ec65d3..3c38b2af49 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeColumnCollection.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeColumnCollection.cs
@@ -1,8 +1,5 @@
using System;
-using System.Collections.Generic;
-using System.Text;
using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.Windows.Forms;
namespace Aga.Controls.Tree
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeNodeAdv.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeNodeAdv.cs
index 609587b9fd..b5fa50fa15 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeNodeAdv.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeNodeAdv.cs
@@ -158,6 +158,12 @@ public bool IsSelected
}
}
+
+ internal void SetSelectedInternal(bool value)
+ {
+ _isSelected = value;
+ }
+
///
/// Returns true if all parent nodes of this node are expanded.
///
@@ -269,6 +275,16 @@ internal TreeNodeAdv BottomNode
}
}
+ internal bool IsVisibleOverride {get
+ {
+ bool visible = true;
+ if (Tree.OnVisibleOverride != null)
+ Tree.OnVisibleOverride(this.Tag, ref visible);
+ return visible;
+ }}
+
+
+
internal TreeNodeAdv NextVisibleNode
{
get
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Designer.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Designer.cs
index b08e6410ba..44aee1a057 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Designer.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Designer.cs
@@ -6,19 +6,6 @@ partial class TreeViewAdv
{
private System.ComponentModel.IContainer components = null;
- protected override void Dispose(bool disposing)
- {
- if (disposing && (components != null))
- {
- components.Dispose();
- if (_dragBitmap != null) _dragBitmap.Dispose();
- if (_dragTimer != null) _dragTimer.Dispose();
- if (_linePen != null) _linePen.Dispose();
- if (_markPen != null) _markPen.Dispose();
- }
- base.Dispose(disposing);
- }
-
#region Component Designer generated code
private void InitializeComponent()
{
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Draw.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Draw.cs
index 75391c302e..9a1007f9e5 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Draw.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Draw.cs
@@ -40,7 +40,8 @@ public void AutoSizeColumn(TreeColumn column)
private void CreatePens()
{
CreateLinePen();
- CreateMarkPen();
+ CreateMarkPen();
+ CreateLine2Pen();
}
private void CreateMarkPen()
@@ -61,6 +62,25 @@ private void CreateLinePen()
_linePen.DashStyle = DashStyle.Dot;
}
+ private void CreateLine2Pen()
+ {
+ _line2Pen = new Pen(_lineColor);
+ }
+
+ protected override void OnPaintBackground(PaintEventArgs pevent)
+ {
+ if (this.BackgroundPaintMode == Tree.BackgroundPaintMode.Gradiant)
+ {
+ Rectangle rc = new Rectangle(0, 0, this.ClientSize.Width, this.ClientSize.Height);
+ using (LinearGradientBrush brush = new LinearGradientBrush(rc, BackColor, BackColor2, 90.0f))
+ {
+ pevent.Graphics.FillRectangle(brush, rc);
+ }
+ }
+ else
+ base.OnPaintBackground(pevent);
+
+ }
protected override void OnPaint(PaintEventArgs e)
{
BeginPerformanceCount();
@@ -76,9 +96,9 @@ protected override void OnPaint(PaintEventArgs e)
if (UseColumns)
{
- DrawColumnHeaders(e.Graphics);
- y += ColumnHeaderHeight;
- if (Columns.Count == 0 || e.ClipRectangle.Height <= y)
+ DrawColumnHeaders(e.Graphics, this.ColumnHeaderBackColor, this.ColumnHeaderBorderColor, this.ColumnHeaderTextColor);
+ y += ActualColumnHeaderHeight;
+ if (Columns.Count == 0 || e.ClipRectangle.Height + e.ClipRectangle.Top <= y)
return;
}
@@ -126,7 +146,7 @@ private void DrawRow(PaintEventArgs e, ref DrawContext context, int row, Rectang
}
else
{
- if (node.IsSelected && Focused)
+ if (node.IsSelected && (Focused || !InactiveSelection))
context.DrawSelection = DrawSelectionMode.Active;
else if (node.IsSelected && !Focused && !HideSelection)
context.DrawSelection = DrawSelectionMode.Inactive;
@@ -143,19 +163,19 @@ private void DrawRow(PaintEventArgs e, ref DrawContext context, int row, Rectang
Rectangle focusRect = new Rectangle(OffsetX, rowRect.Y, ClientRectangle.Width, rowRect.Height);
if (context.DrawSelection == DrawSelectionMode.Active)
{
- e.Graphics.FillRectangle(SystemBrushes.Highlight, focusRect);
+ e.Graphics.FillRectangle(_highlightColorActiveBrush, focusRect);
context.DrawSelection = DrawSelectionMode.FullRowSelect;
}
else
{
- e.Graphics.FillRectangle(SystemBrushes.InactiveBorder, focusRect);
+ e.Graphics.FillRectangle(_highlightColorInactiveBrush, focusRect);
context.DrawSelection = DrawSelectionMode.None;
}
}
}
if ((GridLineStyle & GridLineStyle.Horizontal) == GridLineStyle.Horizontal)
- e.Graphics.DrawLine(SystemPens.InactiveBorder, 0, rowRect.Bottom, e.Graphics.ClipBounds.Right, rowRect.Bottom);
+ e.Graphics.DrawLine(_line2Pen, 0, rowRect.Bottom, e.Graphics.ClipBounds.Right, rowRect.Bottom);
if (ShowLines)
DrawLines(e.Graphics, node, rowRect);
@@ -171,28 +191,36 @@ private void DrawVerticalGridLines(Graphics gr, int y)
if (c.IsVisible)
{
x += c.Width;
- gr.DrawLine(SystemPens.InactiveBorder, x - 1, y, x - 1, gr.ClipBounds.Bottom);
+ gr.DrawLine(_line2Pen, x - 1, y, x - 1, gr.ClipBounds.Bottom);
}
}
}
- private void DrawColumnHeaders(Graphics gr)
+ private void DrawColumnHeaders(Graphics gr, Color back, Color fore, Color text)
{
PerformanceAnalyzer.Start("DrawColumnHeaders");
ReorderColumnState reorder = Input as ReorderColumnState;
int x = 0;
- TreeColumn.DrawBackground(gr, new Rectangle(0, 0, ClientRectangle.Width + 2, ColumnHeaderHeight - 1), false, false);
- gr.TranslateTransform(-OffsetX, 0);
+
+ if (this.CustomDrawHeaders) TreeColumn.DrawCustomBackground(gr, back, fore, new Rectangle(0, 0, ClientRectangle.Width + 2, ActualColumnHeaderHeight - 1), false, false);
+ else TreeColumn.DrawBackground(gr, new Rectangle(0, 0, ClientRectangle.Width + 2, ActualColumnHeaderHeight - 1), false, false);
+
+ gr.TranslateTransform(-OffsetX, 0);
foreach (TreeColumn c in Columns)
{
if (c.IsVisible)
{
if (x >= OffsetX && x - OffsetX < this.Bounds.Width)// skip invisible columns
{
- Rectangle rect = new Rectangle(x, 0, c.Width, ColumnHeaderHeight - 1);
+ Rectangle rect = new Rectangle(x, 0, c.Width, ActualColumnHeaderHeight - 1);
gr.SetClip(rect);
bool pressed = ((Input is ClickColumnState || reorder != null) && ((Input as ColumnState).Column == c));
- c.Draw(gr, rect, Font, pressed, _hotColumn == c);
+
+ if (this.CustomDrawHeaders) TreeColumn.DrawCustomBackground(gr, back, fore, rect, pressed, _hotColumn == c);
+ else TreeColumn.DrawBackground(gr, rect, pressed, _hotColumn == c);
+
+ c.Draw(gr, rect, Font, pressed, _hotColumn == c, text);
+
gr.ResetClip();
if (reorder != null && reorder.DropColumn == c)
@@ -205,7 +233,7 @@ private void DrawColumnHeaders(Graphics gr)
if (reorder != null)
{
if (reorder.DropColumn == null)
- TreeColumn.DrawDropMark(gr, new Rectangle(x, 0, 0, ColumnHeaderHeight));
+ TreeColumn.DrawDropMark(gr, new Rectangle(x, 0, 0, ActualColumnHeaderHeight));
gr.DrawImage(reorder.GhostImage, new Point(reorder.Location.X + + reorder.DragOffset, reorder.Location.Y));
}
PerformanceAnalyzer.Finish("DrawColumnHeaders");
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Editor.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Editor.cs
index b65aca0446..71e20ceb77 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Editor.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Editor.cs
@@ -32,6 +32,8 @@ internal void DisplayEditor(Control editor, EditableControl owner)
_editingNode = CurrentNode;
editor.Validating += EditorValidating;
+ editor.Leave += EditorLeave;
+ editor.LostFocus += EditorLeave;
UpdateEditorBounds();
UpdateView();
editor.Parent = this;
@@ -39,6 +41,11 @@ internal void DisplayEditor(Control editor, EditableControl owner)
owner.UpdateEditor(editor);
}
+ void EditorLeave(object sender, EventArgs e)
+ {
+ HideEditor(true);
+ }
+
internal bool HideEditor(bool applyChanges)
{
if (CurrentEditor != null)
@@ -53,6 +60,8 @@ internal bool HideEditor(bool applyChanges)
if (CurrentEditor != null)
{
CurrentEditor.Validating -= EditorValidating;
+ CurrentEditor.Leave -= EditorLeave;
+ CurrentEditor.LostFocus -= EditorLeave;
CurrentEditorOwner.DoDisposeEditor(CurrentEditor);
CurrentEditor.Parent = null;
@@ -112,7 +121,7 @@ private void SetEditorBounds(EditorContext context)
Point p = info.Bounds.Location;
p.X += info.Control.LeftMargin;
p.X -= OffsetX;
- p.Y -= (_rowLayout.GetRowBounds(FirstVisibleRow).Y - ColumnHeaderHeight);
+ p.Y -= (_rowLayout.GetRowBounds(FirstVisibleRow).Y - ActualColumnHeaderHeight);
int width = DisplayRectangle.Width - p.X;
if (UseColumns && info.Control.ParentColumn != null && Columns.Contains(info.Control.ParentColumn))
{
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Input.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Input.cs
index 57d1ecfbc4..6e0a270664 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Input.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Input.cs
@@ -102,7 +102,7 @@ private TreeNodeAdvMouseEventArgs CreateMouseArgs(MouseEventArgs e)
{
TreeNodeAdvMouseEventArgs args = new TreeNodeAdvMouseEventArgs(e);
args.ViewLocation = new Point(e.X + OffsetX,
- e.Y + _rowLayout.GetRowBounds(FirstVisibleRow).Y - ColumnHeaderHeight);
+ e.Y + _rowLayout.GetRowBounds(FirstVisibleRow).Y - ActualColumnHeaderHeight);
args.ModifierKeys = ModifierKeys;
args.Node = GetNodeAt(e.Location);
NodeControlInfo info = GetNodeControlInfoAt(args.Node, e.Location);
@@ -111,19 +111,24 @@ private TreeNodeAdvMouseEventArgs CreateMouseArgs(MouseEventArgs e)
return args;
}
- protected override void OnMouseWheel(MouseEventArgs e)
- {
- _search.EndSearch();
- if (SystemInformation.MouseWheelScrollLines > 0)
- {
- int lines = e.Delta / 120 * SystemInformation.MouseWheelScrollLines;
- int newValue = _vScrollBar.Value - lines;
- newValue = Math.Min(_vScrollBar.Maximum - _vScrollBar.LargeChange + 1, newValue);
- newValue = Math.Min(_vScrollBar.Maximum, newValue);
- _vScrollBar.Value = Math.Max(_vScrollBar.Minimum, newValue);
- }
- base.OnMouseWheel(e);
- }
+ protected override void OnMouseWheel(MouseEventArgs e)
+ {
+ // e.Delta is no longer fixed to the value 120.
+ const double ScrollBaseFactor = 120;
+ _search.EndSearch();
+ int linesToScroll = SystemInformation.MouseWheelScrollLines;
+
+ if (linesToScroll == -1)
+ linesToScroll = _vScrollBar.LargeChange;
+
+ int lines = (int)(e.Delta / ScrollBaseFactor) * linesToScroll;
+ int newValue = _vScrollBar.Value - lines;
+ newValue = Math.Min(_vScrollBar.Maximum - _vScrollBar.LargeChange + 1, newValue);
+ newValue = Math.Min(_vScrollBar.Maximum, newValue);
+ _vScrollBar.Value = Math.Max(_vScrollBar.Minimum, newValue);
+
+ base.OnMouseWheel(e);
+ }
protected override void OnMouseDown(MouseEventArgs e)
{
@@ -265,7 +270,7 @@ private void SetCursor(MouseEventArgs e)
internal TreeColumn GetColumnAt(Point p)
{
- if (p.Y > ColumnHeaderHeight)
+ if (p.Y > ActualColumnHeaderHeight)
return null;
int x = -OffsetX;
@@ -273,7 +278,7 @@ internal TreeColumn GetColumnAt(Point p)
{
if (col.IsVisible)
{
- Rectangle rect = new Rectangle(x, 0, col.Width, ColumnHeaderHeight);
+ Rectangle rect = new Rectangle(x, 0, col.Width, ActualColumnHeaderHeight);
x += col.Width;
if (rect.Contains(p))
return col;
@@ -300,7 +305,7 @@ internal int GetColumnX(TreeColumn column)
internal TreeColumn GetColumnDividerAt(Point p)
{
- if (p.Y > ColumnHeaderHeight)
+ if (p.Y > ActualColumnHeaderHeight)
return null;
int x = -OffsetX;
@@ -312,8 +317,8 @@ internal TreeColumn GetColumnDividerAt(Point p)
{
if (col.Width > 0)
{
- left = new Rectangle(x, 0, DividerWidth / 2, ColumnHeaderHeight);
- right = new Rectangle(x + col.Width - (DividerWidth / 2), 0, DividerWidth / 2, ColumnHeaderHeight);
+ left = new Rectangle(x, 0, DividerWidth / 2, ActualColumnHeaderHeight);
+ right = new Rectangle(x + col.Width - (DividerWidth / 2), 0, DividerWidth / 2, ActualColumnHeaderHeight);
if (left.Contains(p) && prevCol != null)
return prevCol;
else if (right.Contains(p))
@@ -324,7 +329,7 @@ internal TreeColumn GetColumnDividerAt(Point p)
}
}
- left = new Rectangle(x, 0, DividerWidth / 2, ColumnHeaderHeight);
+ left = new Rectangle(x, 0, DividerWidth / 2, ActualColumnHeaderHeight);
if (left.Contains(p) && prevCol != null)
return prevCol;
@@ -430,7 +435,7 @@ private void SetDropPosition(Point pt)
{
Rectangle first = _rowLayout.GetRowBounds(FirstVisibleRow);
Rectangle bounds = _rowLayout.GetRowBounds(node.Row);
- float pos = (pt.Y + first.Y - ColumnHeaderHeight - bounds.Y) / (float)bounds.Height;
+ float pos = (pt.Y + first.Y - ActualColumnHeaderHeight - bounds.Y) / (float)bounds.Height;
if (pos < TopEdgeSensivity)
_dropPosition.Position = NodePosition.Before;
else if (pos > (1 - BottomEdgeSensivity))
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Properties.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Properties.cs
index 44a8a30c4f..1dfb349a8c 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Properties.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.Properties.cs
@@ -13,8 +13,9 @@ namespace Aga.Controls.Tree
public partial class TreeViewAdv
{
private Cursor _innerCursor = null;
+ public bool CustomDrawHeaders = false;
- public override Cursor Cursor
+ public override Cursor Cursor
{
get
{
@@ -32,6 +33,7 @@ public override Cursor Cursor
#region Internal Properties
private IRowLayout _rowLayout;
+ private IHeaderLayout _headerLayout;
private bool _dragMode;
private bool DragMode
@@ -52,18 +54,10 @@ private bool DragMode
}
}
- // HACK: Made public
- public int ColumnHeaderHeight
- {
- get
- {
- if (UseColumns)
- return _columnHeaderHeight;
- else
- return 0;
- }
- }
-
+ internal int ActualColumnHeaderHeight
+ {
+ get { return UseColumns ? ColumnHeaderHeight : 0; }
+ }
///
/// returns all nodes, which parent is expanded
///
@@ -75,7 +69,7 @@ private IEnumerable VisibleNodes
while (node != null)
{
node = node.NextVisibleNode;
- if (node != null)
+ if (node != null && node.IsVisibleOverride)
yield return node;
}
}
@@ -177,6 +171,27 @@ internal int FirstVisibleRow
}
}
+ public TreeNodeAdv FirstVisibleNode
+ {
+ get
+ {
+ if (_firstVisibleRow >= 0 && _firstVisibleRow < RowMap.Count)
+ return RowMap[_firstVisibleRow];
+ return null;
+ }
+ }
+
+ public TreeNodeAdv LastVisibleNode
+ {
+ get
+ {
+ int lastVisibleRow = _firstVisibleRow + CurrentPageSize - 1;
+ if (lastVisibleRow >= 0 && lastVisibleRow < RowMap.Count)
+ return RowMap[lastVisibleRow];
+ return null;
+ }
+ }
+
private int _offsetX;
public int OffsetX
{
@@ -194,8 +209,8 @@ public override Rectangle DisplayRectangle
get
{
Rectangle r = ClientRectangle;
- //r.Y += ColumnHeaderHeight;
- //r.Height -= ColumnHeaderHeight;
+ //r.Y += ActualColumnHeaderHeight;
+ //r.Height -= ActualColumnHeaderHeight;
int w = _vScrollBar.Visible ? _vScrollBar.Width : 0;
int h = _hScrollBar.Visible ? _hScrollBar.Height : 0;
return new Rectangle(r.X, r.Y, r.Width - w, r.Height - h);
@@ -213,6 +228,85 @@ internal List Selection
#region Public Properties
#region DesignTime
+ private BackgroundPaintMode _backgroundPaintMode = BackgroundPaintMode.Default;
+ [Category("Appearance")]
+ public BackgroundPaintMode BackgroundPaintMode
+ {
+ get
+ {
+ return _backgroundPaintMode;
+ }
+ set
+ {
+ _backgroundPaintMode = value;
+ }
+ }
+
+
+
+ private Color _backgroundColor2 = SystemColors.Window;
+ [Category("Appearance")]
+ public Color BackColor2
+ {
+ get
+ {
+ return _backgroundColor2;
+ }
+ set
+ {
+ _backgroundColor2 = value;
+ }
+ }
+
+
+ private Color _highlightColorActive = SystemColors.Highlight;
+ internal SolidBrush _highlightColorActiveBrush = (SolidBrush)SystemBrushes.Highlight;
+ [Category("Appearance")]
+ public Color HighlightColorActive
+ {
+ get
+ {
+ return _highlightColorActive;
+ }
+ set
+ {
+ _highlightColorActive = value;
+ _highlightColorActiveBrush = new SolidBrush(_highlightColorActive);
+ }
+ }
+
+ private Color _highlightColorInactive = SystemColors.InactiveBorder;
+ internal SolidBrush _highlightColorInactiveBrush = (SolidBrush)SystemBrushes.InactiveBorder;
+
+ [Category("Appearance")]
+ public Color HighlightColorInactive
+ {
+ get
+ {
+ return _highlightColorInactive;
+ }
+ set
+ {
+ _highlightColorInactive = value;
+ _highlightColorInactiveBrush = new SolidBrush(_highlightColorInactive);
+
+ }
+ }
+
+
+ private bool _AutoSpanColumns = false;
+ [DefaultValue(false), Category("Appearance")]
+ public bool AutoSpanColumns
+ {
+ get
+ {
+ return _AutoSpanColumns;
+ }
+ set
+ {
+ _AutoSpanColumns = value;
+ }
+ }
private bool _shiftFirstNode;
[DefaultValue(false), Category("Behavior")]
@@ -373,12 +467,12 @@ public override Font Font
set
{
base.Font = value;
- _columnHeaderHeight = base.Font.Height + 9;
+ ColumnHeaderHeight = base.Font.Height + 9;
}
}
// End font property
- private BorderStyle _borderStyle = BorderStyle.Fixed3D;
+ private BorderStyle _borderStyle = BorderStyle.Fixed3D;
[DefaultValue(BorderStyle.Fixed3D), Category("Appearance")]
public BorderStyle BorderStyle
{
@@ -418,6 +512,28 @@ public bool AutoRowHeight
}
}
+ private bool _autoHeaderHeight = false;
+ ///
+ /// Set to true to expand header height to fit the text of it's largest column.
+ ///
+ [DefaultValue(false), Category("Appearance"), Description("Expand each header height to fit the text of it's largest column.")]
+ public bool AutoHeaderHeight
+ {
+ get
+ {
+ return _autoHeaderHeight;
+ }
+ set
+ {
+ _autoHeaderHeight = value;
+ if (value)
+ _headerLayout = new AutoHeaderHeightLayout(this, ActualColumnHeaderHeight);
+ else
+ _headerLayout = new FixedHeaderHeightLayout(this, ActualColumnHeaderHeight);
+ FullUpdate();
+ }
+ }
+
private GridLineStyle _gridLineStyle = GridLineStyle.None;
[DefaultValue(GridLineStyle.None), Category("Appearance")]
public GridLineStyle GridLineStyle
@@ -476,6 +592,18 @@ public bool HideSelection
}
}
+ bool _inactiveSelection = true;
+ [DefaultValue(true), Category("Behavior")]
+ public bool InactiveSelection
+ {
+ get { return _inactiveSelection; }
+ set
+ {
+ _inactiveSelection = value;
+ UpdateView();
+ }
+ }
+
private float _topEdgeSensivity = 0.3f;
[DefaultValue(0.3f), Category("Behavior")]
public float TopEdgeSensivity
@@ -530,7 +658,43 @@ public int Indent
}
}
- private Color _lineColor = SystemColors.ControlDark;
+ private Color _columnTextColor = SystemColors.ControlText;
+ [Category("Behavior")]
+ public Color ColumnHeaderTextColor
+ {
+ get { return _columnTextColor; }
+ set
+ {
+ _columnTextColor = value;
+ UpdateView();
+ }
+ }
+
+ private Color _columnBackColor = SystemColors.Control;
+ [Category("Behavior")]
+ public Color ColumnHeaderBackColor
+ {
+ get { return _columnBackColor; }
+ set
+ {
+ _columnBackColor = value;
+ UpdateView();
+ }
+ }
+
+ private Color _columnBorderColor = SystemColors.ActiveBorder;
+ [Category("Behavior")]
+ public Color ColumnHeaderBorderColor
+ {
+ get { return _columnBorderColor; }
+ set
+ {
+ _columnBorderColor = value;
+ UpdateView();
+ }
+ }
+
+ private Color _lineColor = SystemColors.ControlDark;
[Category("Behavior")]
public Color LineColor
{
@@ -543,7 +707,20 @@ public Color LineColor
}
}
- private Color _dragDropMarkColor = Color.Black;
+ private Color _lineColor2 = SystemColors.ControlDark;
+ [Category("Behavior")]
+ public Color LineColor2
+ {
+ get { return _lineColor2; }
+ set
+ {
+ _lineColor2 = value;
+ CreateLine2Pen();
+ UpdateView();
+ }
+ }
+
+ private Color _dragDropMarkColor = Color.Black;
[Category("Behavior")]
public Color DragDropMarkColor
{
@@ -604,10 +781,40 @@ public bool AsyncExpanding
set { _asyncExpanding = value; }
}
+ [DefaultValue(20), Category("Appearance")]
+ public int ColumnHeaderHeight
+ {
+ get
+ {
+ return _headerLayout.PreferredHeaderHeight;
+ }
+ set
+ {
+ if (value < 0)
+ throw new ArgumentOutOfRangeException("value");
+ _headerLayout.PreferredHeaderHeight = value;
+ FullUpdate();
+ }
+ }
+
+
#endregion
#region RunTime
+ public delegate void VisibleOverride(object node, ref bool visible);
+
+ private VisibleOverride _onVisibleOverride;
+ public VisibleOverride OnVisibleOverride
+ {
+ get { return _onVisibleOverride; }
+ set
+ {
+ _onVisibleOverride = value;
+ FullUpdate();
+ }
+ }
+
private IToolTipProvider _defaultToolTipProvider = null;
[Browsable(false)]
public IToolTipProvider DefaultToolTipProvider
diff --git a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.cs b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.cs
index d68e910c2a..40748e6026 100644
--- a/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.cs
+++ b/External/3rdParty/Aga-1.7/Aga.Controls/Tree/TreeViewAdv.cs
@@ -25,13 +25,12 @@ public partial class TreeViewAdv : Control
{
private const int LeftMargin = 7;
internal const int ItemDragSensivity = 4;
- // HACK: removed readonly
- private int _columnHeaderHeight;
private const int DividerWidth = 9;
private const int DividerCorrectionGap = -2;
private Pen _linePen;
- private Pen _markPen;
+ private Pen _line2Pen;
+ private Pen _markPen;
private bool _suspendUpdate;
private bool _needFullUpdate;
private bool _fireSelectionEvent;
@@ -77,6 +76,14 @@ internal void OnColumnWidthChanged(TreeColumn column)
ColumnWidthChanged(this, new TreeColumnEventArgs(column));
}
+ [Category("Behavior")]
+ public event EventHandler ColumnHeightChanged;
+ internal void OnColumnHeightChanged(TreeColumn column)
+ {
+ if (ColumnHeightChanged != null)
+ ColumnHeightChanged(this, new TreeColumnEventArgs(column));
+ }
+
[Category("Behavior")]
public event EventHandler ColumnReordered;
internal void OnColumnReordered(TreeColumn column)
@@ -212,11 +219,7 @@ public TreeViewAdv()
| ControlStyles.Selectable
, true);
-
- if (Application.RenderWithVisualStyles)
- _columnHeaderHeight = 20;
- else
- _columnHeaderHeight = 17;
+ _headerLayout = new FixedHeaderHeightLayout(this, Application.RenderWithVisualStyles ? 20: 17);
//BorderStyle = BorderStyle.Fixed3D;
_hScrollBar.Height = SystemInformation.HorizontalScrollBarHeight;
@@ -241,9 +244,9 @@ public TreeViewAdv()
_plusMinus = new NodePlusMinus();
_controls = new NodeControlsCollection(this);
-
- // HACK: commented out
- // Font = _font;
+
+ //HACK: Commented out
+ //Font = _font;
ExpandingIcon.IconChanged += ExpandingIconChanged;
}
@@ -261,7 +264,7 @@ private void DrawIcons()
int y = 0;
if (UseColumns)
{
- y += ColumnHeaderHeight;
+ y += ActualColumnHeaderHeight;
if (Columns.Count == 0)
return;
}
@@ -272,18 +275,21 @@ private void DrawIcons()
DrawContext context = new DrawContext();
context.Graphics = gr;
- for (int i = 0; i < _expandingNodes.Count; i++)
+ lock (_expandingNodes)
{
- foreach (NodeControlInfo item in GetNodeControls(_expandingNodes[i]))
+ for (int i = 0; i < _expandingNodes.Count; i++)
{
- if (item.Control is ExpandingIcon)
+ foreach (NodeControlInfo item in GetNodeControls(_expandingNodes[i]))
{
- Rectangle bounds = item.Bounds;
- if (item.Node.Parent == null && UseColumns)
- bounds.Location = Point.Empty; // display root expanding icon at 0,0
+ if (item.Control is ExpandingIcon)
+ {
+ Rectangle bounds = item.Bounds;
+ if (item.Node.Parent == null && UseColumns)
+ bounds.Location = Point.Empty; // display root expanding icon at 0,0
- context.Bounds = bounds;
- item.Control.Draw(item.Node, context);
+ context.Bounds = bounds;
+ item.Control.Draw(item.Node, context);
+ }
}
}
}
@@ -329,7 +335,7 @@ public NodeControlInfo GetNodeControlInfoAt(Point point)
private NodeControlInfo GetNodeControlInfoAt(TreeNodeAdv node, Point point)
{
Rectangle rect = _rowLayout.GetRowBounds(FirstVisibleRow);
- point.Y += (rect.Y - ColumnHeaderHeight);
+ point.Y += (rect.Y - ActualColumnHeaderHeight);
point.X += OffsetX;
foreach (NodeControlInfo info in GetNodeControls(node))
if (info.Bounds.Contains(point))
@@ -378,13 +384,16 @@ public void EnsureVisible(TreeNodeAdv node)
if (!IsMyNode(node))
throw new ArgumentException();
- TreeNodeAdv parent = node.Parent;
- while (parent != _root)
+ if (node != _root)
{
- parent.IsExpanded = true;
- parent = parent.Parent;
+ TreeNodeAdv parent = node.Parent;
+ while (parent != _root)
+ {
+ parent.IsExpanded = true;
+ parent = parent.Parent;
+ }
+ ScrollTo(node);
}
- ScrollTo(node);
}
///
@@ -410,7 +419,7 @@ public void ScrollTo(TreeNodeAdv node)
{
int pageStart = _rowLayout.GetRowBounds(FirstVisibleRow).Top;
int rowBottom = _rowLayout.GetRowBounds(node.Row).Bottom;
- if (rowBottom > pageStart + DisplayRectangle.Height - ColumnHeaderHeight)
+ if (rowBottom > pageStart + DisplayRectangle.Height - ActualColumnHeaderHeight)
row = _rowLayout.GetFirstRow(node.Row);
}
@@ -441,11 +450,59 @@ internal void ClearSelectionInternal()
}
}
+ public void SpanColumns()
+ {
+ int totalColumns = Columns.Count;
+ int workingWidth = DisplayRectangle.Width - totalColumns;
+ if (totalColumns > 0 && workingWidth > 0)
+ {
+
+ BeginUpdate();
+ int totalColumnsWidth = 0;
+
+ foreach (TreeColumn column in Columns)
+ totalColumnsWidth += column.Width;
+
+ foreach (TreeColumn column in Columns)
+ {
+ int newWidth = (int)Math.Ceiling(workingWidth * (double)column.Width / totalColumnsWidth);
+
+ newWidth = Math.Max(newWidth, column.MinColumnWidth);
+ if (column.MaxColumnWidth != 0)
+ newWidth = Math.Min(newWidth, column.MaxColumnWidth);
+
+ column.Width = newWidth;
+ }
+ EndUpdate();
+ }
+ }
+
#endregion
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing)
+ {
+ AbortBackgroundExpandingThreads();
+ if (_model != null)
+ UnbindModelEvents();
+ ExpandingIcon.IconChanged -= ExpandingIconChanged;
+ if (components != null)
+ components.Dispose();
+ if (_dragBitmap != null) _dragBitmap.Dispose();
+ if (_dragTimer != null) _dragTimer.Dispose();
+ if (_linePen != null) _linePen.Dispose();
+ if (_line2Pen != null) _linePen.Dispose();
+ if (_markPen != null) _markPen.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
protected override void OnSizeChanged(EventArgs e)
{
ArrangeControls();
+ if (AutoSpanColumns)
+ SpanColumns();
SafeUpdateScrollBars();
base.OnSizeChanged(e);
}
@@ -524,6 +581,12 @@ protected override void OnGotFocus(EventArgs e)
base.OnGotFocus(e);
}
+ protected override void OnLostFocus(EventArgs e)
+ {
+ UpdateView();
+ base.OnLostFocus(e);
+ }
+
protected override void OnFontChanged(EventArgs e)
{
base.OnFontChanged(e);
@@ -531,7 +594,7 @@ protected override void OnFontChanged(EventArgs e)
FullUpdate();
}
- // HACK: Made public
+ //HACK: Made public
public IEnumerable GetNodeControls(TreeNodeAdv node)
{
if (node == null)
@@ -541,8 +604,8 @@ public IEnumerable GetNodeControls(TreeNodeAdv node)
yield return n;
}
- // HACK: Made public
- public IEnumerable GetNodeControls(TreeNodeAdv node, Rectangle rowRect)
+ //HACK: Made public
+ public IEnumerable GetNodeControls(TreeNodeAdv node, Rectangle rowRect)
{
if (node == null)
yield break;
@@ -635,6 +698,7 @@ public void FullUpdate()
private void UnsafeFullUpdate()
{
+ _headerLayout.ClearCache();
_rowLayout.ClearCache();
CreateRowMap();
SafeUpdateScrollBars();
@@ -650,7 +714,7 @@ internal void UpdateView()
internal void UpdateHeaders()
{
- Invalidate(new Rectangle(0, 0, Width, ColumnHeaderHeight));
+ Invalidate(new Rectangle(0, 0, Width, ActualColumnHeaderHeight));
}
internal void UpdateColumns()
@@ -677,11 +741,10 @@ internal void ReadChilds(TreeNodeAdv parentNode)
internal void ReadChilds(TreeNodeAdv parentNode, bool performFullUpdate)
{
+ parentNode.Nodes.Clear();
if (!parentNode.IsLeaf)
{
parentNode.IsExpandedOnce = true;
- parentNode.Nodes.Clear();
-
if (Model != null)
{
IEnumerable items = Model.GetChildren(GetPath(parentNode));
@@ -711,7 +774,6 @@ private void AddNode(TreeNodeAdv parent, int index, TreeNodeAdv node)
parent.Nodes.Insert(index, node);
else
parent.Nodes.Add(node);
-
node.IsLeaf = Model.IsLeaf(GetPath(node));
if (node.IsLeaf)
node.Nodes.Clear();
@@ -728,10 +790,13 @@ private struct ExpandArgs
public void AbortBackgroundExpandingThreads()
{
- _threadPool.CancelAll(true);
- for (int i = 0; i < _expandingNodes.Count; i++)
- _expandingNodes[i].IsExpandingNow = false;
- _expandingNodes.Clear();
+ lock (_expandingNodes)
+ {
+ _threadPool.CancelAll(true);
+ for (int i = 0; i < _expandingNodes.Count; i++)
+ _expandingNodes[i].IsExpandingNow = false;
+ _expandingNodes.Clear();
+ }
Invalidate();
}
@@ -815,17 +880,23 @@ internal void SetIsExpanded(TreeNodeAdv node, bool value)
private void RemoveExpandingNode(TreeNodeAdv node)
{
- node.IsExpandingNow = false;
- _expandingNodes.Remove(node);
- if (_expandingNodes.Count <= 0)
- ExpandingIcon.Stop();
+ lock (_expandingNodes)
+ {
+ node.IsExpandingNow = false;
+ _expandingNodes.Remove(node);
+ if (_expandingNodes.Count <= 0)
+ ExpandingIcon.Stop();
+ }
}
private void AddExpandingNode(TreeNodeAdv node)
{
- node.IsExpandingNow = true;
- _expandingNodes.Add(node);
- ExpandingIcon.Start();
+ lock (_expandingNodes)
+ {
+ node.IsExpandingNow = true;
+ _expandingNodes.Add(node);
+ ExpandingIcon.Start();
+ }
}
internal void SetIsExpandedRecursive(TreeNodeAdv root, bool value)
@@ -956,11 +1027,20 @@ internal void ChangeColumnWidth(TreeColumn column)
{
if (!(_input is ResizeColumnState))
{
- FullUpdate();
+ SmartFullUpdate();
OnColumnWidthChanged(column);
}
}
+ internal void ChangeColumnHeight(TreeColumn column)
+ {
+ if (!(_input is ResizeColumnState))
+ {
+ SmartFullUpdate();
+ OnColumnHeightChanged(column);
+ }
+ }
+
public TreeNodeAdv FindNode(TreePath path)
{
return FindNode(path, false);
@@ -1062,6 +1142,54 @@ private void UnbindModelEvents()
_model.StructureChanged -= new EventHandler(_model_StructureChanged);
}
+ private static object[] GetRelativePath(TreeNodeAdv root, TreeNodeAdv node)
+ {
+ int level = 0;
+ TreeNodeAdv current = node;
+ while (current != root && current != null)
+ {
+ current = current.Parent;
+ level++;
+ }
+ if (current != null)
+ {
+ object[] result = new object[level];
+ current = node;
+ while (current != root && current != null)
+ {
+ level--;
+ result[level] = current.Tag;
+ current = current.Parent;
+ }
+ return result;
+ }
+ return null;
+ }
+
+ private TreeNodeAdv FindChildNode(TreeNodeAdv root, object[] relativePath, int level, bool readChilds)
+ {
+ if (relativePath == null)
+ return null;
+ if (level == relativePath.Length)
+ return root;
+
+ if (!root.IsExpandedOnce && readChilds)
+ ReadChilds(root);
+
+ for (int i = 0; i < root.Nodes.Count; i++)
+ {
+ TreeNodeAdv node = root.Nodes[i];
+ if (node.Tag == relativePath[level])
+ {
+ if (level == relativePath.Length - 1)
+ return node;
+ else
+ return FindChildNode(node, relativePath, level + 1, readChilds);
+ }
+ }
+ return null;
+ }
+
private void _model_StructureChanged(object sender, TreePathEventArgs e)
{
if (e.Path == null)
@@ -1073,11 +1201,57 @@ private void _model_StructureChanged(object sender, TreePathEventArgs e)
if (node != Root)
node.IsLeaf = Model.IsLeaf(GetPath(node));
+ object[] currentPath = GetRelativePath(node, _currentNode);
+ object[] selectionStartPath = GetRelativePath(node, _selectionStart);
+ List selectionPaths = new List();
+ List preservedSelection = new List();
+ foreach (var selectionNode in Selection)
+ {
+ object[] selectionPath = GetRelativePath(node, selectionNode);
+ if (selectionPath != null)
+ selectionPaths.Add(selectionPath);
+ else //preserve selection because this selectionNode is not a child of node
+ preservedSelection.Add(selectionNode);
+ }
+
var list = new Dictionary();
SaveExpandedNodes(node, list);
ReadChilds(node);
+
+ bool suspendSelectionEventBefore = SuspendSelectionEvent;
+ bool suspendUpdateBefore = _suspendUpdate;
+ bool fireSelectionBefore = _fireSelectionEvent;
+
+ SuspendSelectionEvent = true;
+ _suspendUpdate = true;
+
RestoreExpandedNodes(node, list);
+ //Restore Selection:
+ _selection.Clear();
+ //restore preserved selection.
+ _selection.AddRange(preservedSelection);
+ //restore selection for child nodes.
+ foreach ( var selectionPath in selectionPaths)
+ {
+ TreeNodeAdv selectionNode = FindChildNode(node, selectionPath, 0, false);
+ if (selectionNode != null)
+ {
+ selectionNode.SetSelectedInternal(true);
+ _selection.Add(selectionNode);
+ }
+ else
+ fireSelectionBefore = true; // selection changed.
+ }
+ if (currentPath != null)
+ _currentNode = FindChildNode(node, currentPath, 0, false);
+ if (selectionStartPath != null)
+ _selectionStart = FindChildNode(node, selectionStartPath, 0, false);
+
+ _fireSelectionEvent = fireSelectionBefore;
+ _suspendUpdate = suspendUpdateBefore;
+ SuspendSelectionEvent = suspendSelectionEventBefore;
+
UpdateSelection();
SmartFullUpdate();
}
@@ -1087,7 +1261,7 @@ private void _model_StructureChanged(object sender, TreePathEventArgs e)
private void RestoreExpandedNodes(TreeNodeAdv node, Dictionary list)
{
- if (node.Tag != null && list.ContainsKey(node.Tag))
+ if (node == Root || (node.Tag != null && list.ContainsKey(node.Tag))) //Root.Tag always is null, and Root always expanded
{
node.IsExpanded = true;
foreach (var child in node.Children)
@@ -1097,11 +1271,14 @@ private void RestoreExpandedNodes(TreeNodeAdv node, Dictionary l
private void SaveExpandedNodes(TreeNodeAdv node, Dictionary list)
{
- if (node.IsExpanded && node.Tag != null)
+ var isRoot = node == Root;
+ if (isRoot || (node.IsExpanded && node.Tag != null)) //Root.Tag always is null, and Root always expanded
{
- list.Add(node.Tag, null);
- foreach (var child in node.Children)
- SaveExpandedNodes(child, list);
+ if (!isRoot)
+ list.Add(node.Tag, null);
+
+ foreach (var child in node.Children)
+ SaveExpandedNodes(child, list);
}
}
@@ -1110,31 +1287,38 @@ private void _model_NodesRemoved(object sender, TreeModelEventArgs e)
TreeNodeAdv parent = FindNode(e.Path);
if (parent != null)
{
- if (e.Indices != null)
+ if (parent.IsExpandedOnce)
{
- List list = new List(e.Indices);
- list.Sort();
- for (int n = list.Count - 1; n >= 0; n--)
+ if (e.Indices != null)
{
- int index = list[n];
- if (index >= 0 && index <= parent.Nodes.Count)
- parent.Nodes.RemoveAt(index);
- else
- throw new ArgumentOutOfRangeException("Index out of range");
+ List list = new List(e.Indices);
+ list.Sort();
+ for (int n = list.Count - 1; n >= 0; n--)
+ {
+ int index = list[n];
+ if (index >= 0 && index <= parent.Nodes.Count)
+ parent.Nodes.RemoveAt(index);
+ else
+ throw new ArgumentOutOfRangeException("Index out of range");
+ }
}
- }
- else
- {
- for (int i = parent.Nodes.Count - 1; i >= 0; i--)
+ else
{
- for (int n = 0; n < e.Children.Length; n++)
- if (parent.Nodes[i].Tag == e.Children[n])
- {
- parent.Nodes.RemoveAt(i);
- break;
- }
+ for (int i = parent.Nodes.Count - 1; i >= 0; i--)
+ {
+ for (int n = 0; n < e.Children.Length; n++)
+ if (parent.Nodes[i].Tag == e.Children[n])
+ {
+ parent.Nodes.RemoveAt(i);
+ break;
+ }
+ }
}
+ if (parent.Nodes.Count == 0)
+ parent.IsLeaf = Model.IsLeaf(e.Path);
}
+ else
+ parent.IsLeaf = Model.IsLeaf(e.Path);
}
UpdateSelection();
SmartFullUpdate();
@@ -1148,8 +1332,13 @@ private void _model_NodesInserted(object sender, TreeModelEventArgs e)
TreeNodeAdv parent = FindNode(e.Path);
if (parent != null)
{
- for (int i = 0; i < e.Children.Length; i++)
- AddNewNode(parent, e.Children[i], e.Indices[i]);
+ if (parent.IsExpandedOnce)
+ {
+ for (int i = 0; i < e.Children.Length; i++)
+ AddNewNode(parent, e.Children[i], e.Indices[i]);
+ }
+ else if (parent.IsLeaf)
+ parent.IsLeaf = Model.IsLeaf(e.Path);
}
SmartFullUpdate();
}
diff --git a/External/3rdParty/Aga-1.7/ReleaseNotes.txt b/External/3rdParty/Aga-1.7/ReleaseNotes.txt
index c947deae07..2c103f2f32 100644
--- a/External/3rdParty/Aga-1.7/ReleaseNotes.txt
+++ b/External/3rdParty/Aga-1.7/ReleaseNotes.txt
@@ -1,3 +1,34 @@
+1.7.0.1 (r98)
+[r98] Fixed: Issue #44 - tree nodes are now properly saved and restored when 'ITreeModel.StructureChanged' event is raised.
+[r97] Fixed: Issue #23, added support for whole page mouse scrolling
+[r96] Added: Option to choose custom highlight colors
+[r95] Fixed: Issue #48 UseCompatibleTextRendering is backwards
+[r94] Added: Option to auto span columns
+[r93] Fixed: TreeView control sometimes not being updated when using columns
+[r92] Added: Option to Highlight text for BaseTextControl
+[r91] Added: custom background paint mode
+[r90] Fixed: Incorrect behavior of TreeViewAdv.ColumnHeaderHeight property, logic and design is now separated.
+[r89] Option to modify node visibility via callback
+[r88] NodeTextBox: Process Enter, Escape Key as Input Key.
+[r87] NodesInserted and NodesRemoved events now supports the case, when the parent has not been loaded.
+[r86] added ColumnHeaderHeight, AutoHeaderHeight Property.
+ Used default for AutoHeaderHeight False (not as in patch used).
+[r85] When the last child of an item is removed it becomes to be a leaf. in this case, parentNode.Nodes.Clear() was not called and the child is not removed from Nodes list. (bug in ReadChilds method).
+[r84] bugfix of bugfix
+[r83] Bug while restoring the Selection after StructureChange is now fixed (hopefully definitely). Laurent Nicot, thanks for the detailed feedback and the Test-Case.
+[r82] Fixed a bug: selected nodes were not correctly restored after structure change event.
+[r81] EnsureVisible(TreeNodeAdv node) does not fail in case the node parameter is the root node.
+[r80] Bugfix: StructureChange missed to clear _selection on restore (causing invalid SelectedNode in case the selection path is not found anymore).
+[r79] prevent unneeded selection change event on structure change
+[r78] Don't reset scroll position on structure change.
+[r77] Fix threading problem with _expandingNodes related to AbortBackgroundExpandingThreads()
+[r76] - FIX: Redraw when Focus Lost ( to update selection color from active to inactive).
+- NEW: Property InactiveSelection on TreeViewAdv to choose if selection gets inactive or not when unfocused.
+ - FIX: Try to Restore Selection when StructureChanged
+[r75] NodeCheckBox has a new Property ReverseCheckOrder: changes the order from Indeterminate, Unchecked, Checked to Indeterminate, Checked, Unchecked.
+[r74] TreeViewAdv.cs, TreeViewAdv.Designer.cs: moved and completed Dispose method. Unregister events on dispose to prevent memory-leaks: ExpandingIcon.IconChanged event to static Object was never unregistered -> tree view was not collected by garbage collection until application quits.
+[r73] node edit bug
+
1.7.0
+ EditableNodeControl imroved
+ NodeCombobox improved
diff --git a/External/3rdParty/Aga-1.7/TreeViewAdv.sln b/External/3rdParty/Aga-1.7/TreeViewAdv.sln
index 28c2a2e0ce..6e653ae427 100644
--- a/External/3rdParty/Aga-1.7/TreeViewAdv.sln
+++ b/External/3rdParty/Aga-1.7/TreeViewAdv.sln
@@ -1,6 +1,8 @@
-Microsoft Visual Studio Solution File, Format Version 10.00
-# Visual C# Express 2008
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.23107.0
+MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Aga.Controls", "Aga.Controls\Aga.Controls.csproj", "{E73BB233-D88B-44A7-A98F-D71EE158381D}"
EndProject
Global
diff --git a/External/3rdParty/Duplicate/Duplicate.csproj b/External/3rdParty/Duplicate/Duplicate.csproj
index 8ac191a7aa..38a487b43e 100644
--- a/External/3rdParty/Duplicate/Duplicate.csproj
+++ b/External/3rdParty/Duplicate/Duplicate.csproj
@@ -3,8 +3,6 @@
Debug
AnyCPU
- 9.0.30729
- 2.0
{7AF50A69-26D3-400B-9DFF-96CB36E1A871}
Library
Properties
@@ -14,8 +12,11 @@
- 2.0
- v2.0
+ net48
+ true
+ false
+ false
+ false
@@ -50,14 +51,6 @@
TRACE
true
-
-
False
diff --git a/External/3rdParty/Scintilla/additional_keywords.patch b/External/3rdParty/Scintilla/additional_keywords.patch
index fbf1381ab0..afa80d85ad 100644
--- a/External/3rdParty/Scintilla/additional_keywords.patch
+++ b/External/3rdParty/Scintilla/additional_keywords.patch
@@ -1,65 +1,65 @@
-diff -r 1092d3d24959 include/SciLexer.h
---- a/include/SciLexer.h Tue Jan 15 09:51:15 2013 +1100
-+++ b/include/SciLexer.h Wed Feb 06 22:13:27 2013 +0100
-@@ -161,6 +161,9 @@
- #define SCE_C_TRIPLEVERBATIM 21
- #define SCE_C_HASHQUOTEDSTRING 22
- #define SCE_C_PREPROCESSORCOMMENT 23
-+#define SCE_C_WORD3 24
-+#define SCE_C_WORD4 25
-+#define SCE_C_WORD5 26
+diff --git a/include/SciLexer.h b/include/SciLexer.h
+--- a/include/SciLexer.h
++++ b/include/SciLexer.h
+@@ -177,6 +177,9 @@
+ #define SCE_C_USERLITERAL 25
+ #define SCE_C_TASKMARKER 26
+ #define SCE_C_ESCAPESEQUENCE 27
++#define SCE_C_WORD3 100
++#define SCE_C_WORD4 101
++#define SCE_C_WORD5 102
#define SCE_D_DEFAULT 0
#define SCE_D_COMMENT 1
#define SCE_D_COMMENTLINE 2
-diff -r 1092d3d24959 lexers/LexCPP.cxx
---- a/lexers/LexCPP.cxx Tue Jan 15 09:51:15 2013 +1100
-+++ b/lexers/LexCPP.cxx Wed Feb 06 22:13:27 2013 +0100
-@@ -247,6 +247,9 @@
- "Documentation comment keywords",
+diff --git a/lexers/LexCPP.cxx b/lexers/LexCPP.cxx
+--- a/lexers/LexCPP.cxx
++++ b/lexers/LexCPP.cxx
+@@ -353,6 +353,9 @@
"Global classes and typedefs",
"Preprocessor definitions",
+ "Task marker and error marker keywords",
+ "Extended(1) keywords and identifiers",
+ "Extended(2) keywords and identifiers",
+ "Extended(3) keywords and identifiers",
0,
};
-@@ -323,6 +326,9 @@
+@@ -443,6 +446,9 @@
WordList keywords2;
WordList keywords3;
WordList keywords4;
-+ WordList keywords5;
-+ WordList keywords6;
-+ WordList keywords7;
++ WordList keywords5;
++ WordList keywords6;
++ WordList keywords7;
WordList ppDefinitions;
- std::map preprocessorDefinitionsStart;
- OptionsCPP options;
-@@ -411,6 +417,15 @@
- case 4:
+ WordList markerList;
+ struct SymbolValue {
+@@ -587,6 +593,15 @@
wordListN = &ppDefinitions;
break;
-+ case 5:
-+ wordListN = &keywords5;
-+ break;
-+ case 6:
-+ wordListN = &keywords6;
-+ break;
-+ case 7:
-+ wordListN = &keywords7;
-+ break;
+ case 5:
++ wordListN = &keywords5;
++ break;
++ case 6:
++ wordListN = &keywords6;
++ break;
++ case 7:
++ wordListN = &keywords7;
++ break;
++ case 8:
+ wordListN = &markerList;
+ break;
}
- int firstModification = -1;
- if (wordListN) {
-@@ -605,6 +620,12 @@
+@@ -809,6 +824,12 @@
sc.ChangeState(SCE_C_WORD2|activitySet);
} else if (keywords4.InList(s)) {
sc.ChangeState(SCE_C_GLOBALCLASS|activitySet);
+ } else if (keywords5.InList(s)) {
-+ sc.ChangeState(SCE_C_WORD3|activitySet);
-+ } else if (keywords6.InList(s)) {
-+ sc.ChangeState(SCE_C_WORD4|activitySet);
-+ } else if (keywords7.InList(s)) {
-+ sc.ChangeState(SCE_C_WORD5|activitySet);
- }
- const bool literalString = sc.ch == '\"';
- if (literalString || sc.ch == '\'') {
++ sc.ChangeState(SCE_C_WORD3|activitySet);
++ } else if (keywords6.InList(s)) {
++ sc.ChangeState(SCE_C_WORD4|activitySet);
++ } else if (keywords7.InList(s)) {
++ sc.ChangeState(SCE_C_WORD5|activitySet);
+ } else {
+ int subStyle = classifierIdentifiers.ValueFor(s);
+ if (subStyle >= 0) {
diff --git a/External/3rdParty/Trace/Resources/en_US.resX b/External/3rdParty/Trace/Resources/en_US.resx
similarity index 100%
rename from External/3rdParty/Trace/Resources/en_US.resX
rename to External/3rdParty/Trace/Resources/en_US.resx
diff --git a/External/3rdParty/Trace/Trace.csproj b/External/3rdParty/Trace/Trace.csproj
index 1ea23c58a1..831f7aa5a3 100644
--- a/External/3rdParty/Trace/Trace.csproj
+++ b/External/3rdParty/Trace/Trace.csproj
@@ -3,8 +3,6 @@
Debug
AnyCPU
- 9.0.30729
- 2.0
{78101C01-E186-4954-B1DD-DEBB7905FAD8}
Library
Properties
@@ -14,8 +12,11 @@
- 2.0
- v2.0
+ net48
+ true
+ false
+ false
+ false
@@ -65,14 +66,6 @@
TRACE
true
-
-
False
@@ -98,7 +91,7 @@
-
+
Designer
diff --git a/External/Archive/FlashDebugger/FlashDebugger.csproj b/External/Archive/FlashDebugger/FlashDebugger.csproj
index ae664a224a..27731fd483 100644
--- a/External/Archive/FlashDebugger/FlashDebugger.csproj
+++ b/External/Archive/FlashDebugger/FlashDebugger.csproj
@@ -3,8 +3,6 @@
Debug
AnyCPU
- 9.0.30729
- 2.0
{194B58C9-9D2B-4D5E-9256-773FD3222582}
Library
Properties
@@ -14,8 +12,11 @@
- 2.0
- v2.0
+ net48
+ true
+ false
+ false
+ false
@@ -49,14 +50,6 @@
TRACE
true
-
-
False
@@ -400,7 +393,7 @@
-
+
Designer
diff --git a/External/Archive/FlashDebugger/FlexSDK/FlashDbg/FlashDbg.resX b/External/Archive/FlashDebugger/FlexSDK/FlashDbg/FlashDbg.resx
similarity index 100%
rename from External/Archive/FlashDebugger/FlexSDK/FlashDbg/FlashDbg.resX
rename to External/Archive/FlashDebugger/FlexSDK/FlashDbg/FlashDbg.resx
diff --git a/External/Archive/FlashDebugger/FlexSDK/SwfUtils/flash/swf/NotUsed/TagEncoder.cs b/External/Archive/FlashDebugger/FlexSDK/SwfUtils/flash/swf/NotUsed/TagEncoder.cs
index f73290ca23..61fa2ef8cb 100644
--- a/External/Archive/FlashDebugger/FlexSDK/SwfUtils/flash/swf/NotUsed/TagEncoder.cs
+++ b/External/Archive/FlashDebugger/FlexSDK/SwfUtils/flash/swf/NotUsed/TagEncoder.cs
@@ -1,2314 +1,2314 @@
-////////////////////////////////////////////////////////////////////////////////
-//
-// ADOBE SYSTEMS INCORPORATED
-// Copyright 2003-2007 Adobe Systems Incorporated
-// All Rights Reserved.
-//
-// NOTICE: Adobe permits you to use, modify, and distribute this file
-// in accordance with the terms of the license agreement accompanying it.
-//
-////////////////////////////////////////////////////////////////////////////////
-using System;
-using flash.swf.tags;
-using ButtonCondAction = flash.swf.types.ButtonCondAction;
-using ButtonRecord = flash.swf.types.ButtonRecord;
-using CXForm = flash.swf.types.CXForm;
-using CXFormWithAlpha = flash.swf.types.CXFormWithAlpha;
-using CurvedEdgeRecord = flash.swf.types.CurvedEdgeRecord;
-using EdgeRecord = flash.swf.types.EdgeRecord;
-using FillStyle = flash.swf.types.FillStyle;
-using GlyphEntry = flash.swf.types.GlyphEntry;
-using GradRecord = flash.swf.types.GradRecord;
-using ImportRecord = flash.swf.types.ImportRecord;
-using KerningRecord = flash.swf.types.KerningRecord;
-using LineStyle = flash.swf.types.LineStyle;
-using MD5 = flash.swf.types.MD5;
-using Matrix = flash.swf.types.Matrix;
-using MorphFillStyle = flash.swf.types.MorphFillStyle;
-using MorphGradRecord = flash.swf.types.MorphGradRecord;
-using MorphLineStyle = flash.swf.types.MorphLineStyle;
-using Rect = flash.swf.types.Rect;
-using Shape = flash.swf.types.Shape;
-using ShapeRecord = flash.swf.types.ShapeRecord;
-using ShapeWithStyle = flash.swf.types.ShapeWithStyle;
-using SoundInfo = flash.swf.types.SoundInfo;
-using StraightEdgeRecord = flash.swf.types.StraightEdgeRecord;
-using StyleChangeRecord = flash.swf.types.StyleChangeRecord;
-using TextRecord = flash.swf.types.TextRecord;
-using Filter = flash.swf.types.Filter;
-using DropShadowFilter = flash.swf.types.DropShadowFilter;
-using BlurFilter = flash.swf.types.BlurFilter;
-using ColorMatrixFilter = flash.swf.types.ColorMatrixFilter;
-using GlowFilter = flash.swf.types.GlowFilter;
-using ConvolutionFilter = flash.swf.types.ConvolutionFilter;
-using BevelFilter = flash.swf.types.BevelFilter;
-using GradientGlowFilter = flash.swf.types.GradientGlowFilter;
-using GradientBevelFilter = flash.swf.types.GradientBevelFilter;
-using Gradient = flash.swf.types.Gradient;
-using FocalGradient = flash.swf.types.FocalGradient;
-namespace flash.swf
-{
-
- public class TagEncoder:TagHandler, TagValues
- {
- virtual public int Pos
- {
- get
- {
- return writer.Pos;
- }
-
- }
- virtual protected internal int SwfVersion
- {
- get
- {
- return header_Renamed_Field.version;
- }
-
- }
- virtual protected internal int FrameRate
- {
- get
- {
- return header_Renamed_Field.rate;
- }
-
- }
- virtual public Dictionary EncoderDictionary
- {
- set
- {
- assert((this.dict == null) || (this.dict.ids.Count == 0));
- this.dict = value;
- }
-
- }
- virtual public Dictionary Dictionary
- {
- get
- {
- return dict;
- }
-
- }
- virtual public bool Debug
- {
- get
- {
- return debug != null;
- }
-
- }
- virtual public int Width
- {
- get
- {
- return width / 20;
- }
-
- }
- virtual public int Height
- {
- get
- {
- return height / 20;
- }
-
- }
- virtual public System.String MainDebugScript
- {
- set
- {
- debug.MainDebugScript = value;
- }
-
- }
- override public SetBackgroundColor BackgroundColor
- {
- set
- {
- encodeTagHeader(value.code, 3, false);
- encodeRGB(value.color, writer);
- }
-
- }
- override public SetTabIndex TabIndex
- {
- set
- {
- tagw.writeUI16(value.depth);
- tagw.writeUI16(value.index);
- encodeTag(value);
- }
-
- }
- // changed from private to protected to support Flash Authoring - jkamerer 2007.07.30
- protected internal SwfEncoder writer;
- private SwfEncoder tagw;
- private int width;
- private int height;
- private int frames;
- private int framecountPos;
- private DebugEncoder debug;
- private Header header_Renamed_Field;
-
- protected internal Dictionary dict;
- private int uuidOffset;
-
- public TagEncoder()
- {
- dict = new Dictionary();
- }
-
- public TagEncoder(Dictionary dict)
- {
- this.dict = dict;
- }
-
- public override void productInfo(ProductInfo tag)
- {
- tagw.write32(tag.Product);
- tagw.write32(tag.Edition);
- tagw.write(new sbyte[]{tag.MajorVersion, tag.MinorVersion});
- tagw.write64(tag.Build);
- tagw.write64(tag.CompileDate);
- encodeTag(tag);
- }
-
- public override void fileAttributes(FileAttributes tag)
- {
- tagw.writeUBits(0, 3);
- tagw.writeBit(tag.hasMetadata);
- tagw.writeBit(tag.actionScript3);
- tagw.writeBit(tag.suppressCrossDomainCaching);
- tagw.writeBit(tag.swfRelativeUrls);
- tagw.writeBit(tag.useNetwork);
- tagw.writeUBits(0, 24);
- encodeTag(tag);
- }
-
- public override void metadata(Metadata tag)
- {
- tagw.writeString(tag.xml);
- encodeTag(tag);
- }
-
- protected internal virtual SwfEncoder createEncoder(int swfVersion)
- {
- return new SwfEncoder(swfVersion);
- }
-
- public override void header(Header header)
- {
- // get some header properties we need to know
- int swfVersion = header.version;
- this.header_Renamed_Field = header;
- this.writer = createEncoder(swfVersion);
- this.tagw = createEncoder(swfVersion);
- width = header.size.Width;
- height = header.size.Height;
- frames = 0;
-
- // write the header
- writer.writeUI8(header.compressed?'C':'F');
- writer.writeUI8('W');
- writer.writeUI8('S');
- writer.writeUI8(header.version);
- writer.write32((int) header.length);
- if (header.compressed)
- {
- writer.markComp();
- }
- encodeRect(header.size, writer);
- writer.writeUI8(header.rate >> 8);
- writer.writeUI8(header.rate & 255);
- framecountPos = writer.Pos;
- writer.writeUI16(header.framecount);
- }
-
- public override void finish()
- {
- // write end marker
- writer.writeUI16(0);
-
- // update the length
- writer.write32at(4, writer.Pos);
-
- // update the frame count
- writer.writeUI16at(framecountPos, frames);
-
- if (debug != null)
- {
- // compute a crc and use it for the debug id. that way it
- // is wholly dependent on the bytes in the SWF and not some
- // outside value. If any of the bytes are different,
- // then the UUID will be different.
- sbyte[] md5 = MD5.getDigest(writer.ByteArray, writer.Length);
- writer.writeAt(uuidOffset, md5);
- debug.updateUUID(md5);
- }
- }
-
- public virtual void writeTo(System.IO.Stream out_Renamed)
- {
- writer.WriteTo(out_Renamed);
- }
-
-
- public virtual void writeDebugTo(System.IO.Stream out_Renamed)
- {
- debug.writeTo(out_Renamed);
- }
-
- public virtual void encodeRect(Rect r, SwfEncoder w)
- {
- int nBits = r.nbits();
- w.writeUBits(nBits, 5);
- w.writeSBits(r.xMin, nBits);
- w.writeSBits(r.xMax, nBits);
- w.writeSBits(r.yMin, nBits);
- w.writeSBits(r.yMax, nBits);
- w.flushBits();
- }
-
- public override void debugID(DebugID tag)
- {
- encodeTagHeader(tag.code, tag.uuid.bytes.Length, false);
- uuidOffset = writer.Pos;
- writer.write(tag.uuid.bytes);
-
- debug = new DebugEncoder();
- debug.header(SwfVersion);
- debug.uuid(tag.uuid);
- }
-
- private void encodeTag(Tag tag)
- {
- try
- {
- tagw.compress();
- encodeTagHeader(tag.code, tagw.Pos, isLongHeader(tag));
- tagw.WriteTo(writer);
- tagw.reset();
- }
- catch (System.IO.IOException e)
- {
- assert(false);
- }
- }
-
- private bool isLongHeader(Tag t)
- {
- switch (t.code)
- {
-
- // [preilly] In the player code, ScriptThread::DefineBits() assumes all DefineBits
- // tags use a long header. See "ch->data = AttachData(pos-8);". If the player
- // also supported a short header, it would use "pos-4".
- case flash.swf.TagValues_Fields.stagDefineBits:
- case flash.swf.TagValues_Fields.stagDefineBitsJPEG2:
- case flash.swf.TagValues_Fields.stagDefineBitsJPEG3:
- case flash.swf.TagValues_Fields.stagDefineBitsLossless:
- case flash.swf.TagValues_Fields.stagDefineBitsLossless2:
- return true;
-
- // [ed] the FlashPaper codebase also indicates that stagSoundStreamBlock must use
- // a long format header. todo - verify by looking at the player code.
-
- case flash.swf.TagValues_Fields.stagSoundStreamBlock:
- return true;
-
- // [edsmith] these tags have code in them. When we're writing a SWD, we use long headers
- // so we can predict SWF offsets correctly when writing SWD line/offset records.
-
- case flash.swf.TagValues_Fields.stagDefineButton:
- case flash.swf.TagValues_Fields.stagDefineButton2:
- case flash.swf.TagValues_Fields.stagDefineSprite:
- case flash.swf.TagValues_Fields.stagDoInitAction:
- case flash.swf.TagValues_Fields.stagDoAction:
- return Debug;
-
-
- case flash.swf.TagValues_Fields.stagPlaceObject2:
- return Debug && ((PlaceObject) t).hasClipAction();
-
- // all other tags will use short/long headers depending on their length
-
- default:
- return false;
-
- }
- }
-
- private void encodeTagHeader(int code, int length, bool longHeader)
- {
- if (longHeader || length >= 63)
- {
- writer.writeUI16((code << 6) | 63);
- writer.write32(length);
- }
- else
- {
- writer.writeUI16((code << 6) | length);
- }
- }
-
- public override void defineScalingGrid(DefineScalingGrid tag)
- {
- int idref = dict.getId(tag.scalingTarget);
- tagw.writeUI16(idref);
- encodeRect(tag.rect, tagw);
- encodeTag(tag);
- }
-
- public override void defineBinaryData(DefineBinaryData tag)
- {
- encodeTagHeader(tag.code, 6 + tag.data.Length, false);
- int id = dict.add(tag);
- writer.writeUI16(id);
- writer.write32(tag.reserved);
- writer.write(tag.data);
- }
-
- public override void defineBits(DefineBits tag)
- {
- encodeTagHeader(tag.code, 2 + tag.data.Length, true);
- int id = dict.add(tag);
- writer.writeUI16(id);
- writer.write(tag.data);
- }
-
- public override void defineBitsJPEG2(DefineBits tag)
- {
- defineBits(tag);
- }
-
- public override void defineBitsJPEG3(DefineBitsJPEG3 tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
- tagw.write32(tag.data.Length);
- tagw.write(tag.data);
- tagw.markComp();
- tagw.write(tag.alphaData);
- encodeTag(tag);
- }
-
- public override void defineBitsLossless(DefineBitsLossless tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
- tagw.writeUI8(tag.format);
- tagw.writeUI16(tag.width);
- tagw.writeUI16(tag.height);
- switch (tag.format)
- {
-
- case 3:
- tagw.writeUI8(tag.colorData.Length - 1);
- tagw.markComp();
- encodeColorMapData(tag.colorData, tag.data, tagw);
- break;
-
- case 4:
- case 5:
- tagw.markComp();
- encodeBitmapData(tag.data, tagw);
- break;
- }
- encodeTag(tag);
- }
-
- private void encodeBitmapData(sbyte[] data, SwfEncoder w)
- {
- w.write(data);
- }
-
- private void encodeColorMapData(int[] colorData, sbyte[] pixelData, SwfEncoder w)
- {
- for (int i = 0; i < colorData.Length; i++)
- {
- encodeRGB(colorData[i], w);
- }
- w.write(pixelData);
- }
-
- /// as 0x00RRGGBB
- ///
- ///
- ///
- private void encodeRGB(int rgb, SwfEncoder w)
- {
- w.writeUI8(SupportClass.URShift(rgb, 16)); // red. we don't mask this because if rgb has an Alpha value, something's wrong
- w.writeUI8((SupportClass.URShift(rgb, 8)) & 255);
- w.writeUI8(rgb & 255); // blue
- }
-
- public override void defineBitsLossless2(DefineBitsLossless tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
- tagw.writeUI8(tag.format);
- tagw.writeUI16(tag.width);
- tagw.writeUI16(tag.height);
- switch (tag.format)
- {
-
- case 3:
- tagw.writeUI8(tag.colorData.Length - 1);
- tagw.markComp();
- encodeAlphaColorMapData(tag.colorData, tag.data, tagw);
- break;
-
- case 4:
- case 5:
- tagw.markComp();
- encodeBitmapData(tag.data, tagw);
- break;
- }
- encodeTag(tag);
- }
-
- private void encodeAlphaColorMapData(int[] colorData, sbyte[] pixelData, SwfEncoder w)
- {
- for (int i = 0; i < colorData.Length; i++)
- {
- encodeRGBA(colorData[i], w);
- }
- w.write(pixelData);
- }
-
- /// as 0xAARRGGBB
- ///
- ///
- ///
- private void encodeRGBA(int rgba, SwfEncoder w)
- {
- w.writeUI8((SupportClass.URShift(rgba, 16)) & 255); // red
- w.writeUI8((SupportClass.URShift(rgba, 8)) & 255); // green
- w.writeUI8(rgba & 255); // blue
- w.writeUI8(SupportClass.URShift(rgba, 24)); // alpha
- }
-
- public override void defineButton(DefineButton tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
-
- if (Debug)
- {
- debug.adjust = writer.Pos + 6;
- }
-
- for (int i = 0; i < tag.buttonRecords.Length; i++)
- {
- encodeButtonRecord(tag.buttonRecords[i], tagw, tag.code);
- }
- tagw.writeUI8(0); // no more button records
-
- // assume there is only one condition we will handle
- new ActionEncoder(tagw, debug).encode(tag.condActions[0].actionList);
- tagw.writeUI8(0); // write action end flag, must be zero
- encodeTag(tag);
-
- if (Debug)
- {
- debug.adjust = 0;
- }
- }
-
- private void encodeButtonRecord(ButtonRecord record, SwfEncoder w, int defineButton)
- {
- if (defineButton == flash.swf.TagValues_Fields.stagDefineButton2)
- {
- w.writeUBits(0, 2);
- w.writeBit(record.blendMode != - 1);
- w.writeBit(record.filters != null);
- }
- else
- {
- w.writeUBits(0, 4);
- }
- w.writeBit(record.hitTest);
- w.writeBit(record.down);
- w.writeBit(record.over);
- w.writeBit(record.up);
-
- w.writeUI16(dict.getId(record.characterRef));
- w.writeUI16(record.placeDepth);
- encodeMatrix(record.placeMatrix, w);
-
- if (defineButton == flash.swf.TagValues_Fields.stagDefineButton2)
- {
- encodeCxforma(record.colorTransform, w);
- if (record.filters != null)
- {
- this.encodeFilterList(record.filters, w);
- }
- if (record.blendMode != - 1)
- {
- w.writeUI8(record.blendMode);
- }
- }
- }
-
- private void encodeCxforma(CXFormWithAlpha cxforma, SwfEncoder w)
- {
- w.writeBit(cxforma.hasAdd);
- w.writeBit(cxforma.hasMult);
-
- int nbits = cxforma.nbits();
- w.writeUBits(nbits, 4);
-
- if (cxforma.hasMult)
- {
- w.writeSBits(cxforma.redMultTerm, nbits);
- w.writeSBits(cxforma.greenMultTerm, nbits);
- w.writeSBits(cxforma.blueMultTerm, nbits);
- w.writeSBits(cxforma.alphaMultTerm, nbits);
- }
-
- if (cxforma.hasAdd)
- {
- w.writeSBits(cxforma.redAddTerm, nbits);
- w.writeSBits(cxforma.greenAddTerm, nbits);
- w.writeSBits(cxforma.blueAddTerm, nbits);
- w.writeSBits(cxforma.alphaAddTerm, nbits);
- }
-
- w.flushBits();
- }
-
- private void encodeMatrix(Matrix matrix, SwfEncoder w)
- {
- w.writeBit(matrix.hasScale);
- if (matrix.hasScale)
- {
- int nScaleBits = matrix.nScaleBits();
- w.writeUBits(nScaleBits, 5);
- w.writeSBits(matrix.scaleX, nScaleBits);
- w.writeSBits(matrix.scaleY, nScaleBits);
- }
-
- w.writeBit(matrix.hasRotate);
- if (matrix.hasRotate)
- {
- int nRotateBits = matrix.nRotateBits();
- w.writeUBits(nRotateBits, 5);
- w.writeSBits(matrix.rotateSkew0, nRotateBits);
- w.writeSBits(matrix.rotateSkew1, nRotateBits);
- }
-
- int nTranslateBits = matrix.nTranslateBits();
- w.writeUBits(nTranslateBits, 5);
- w.writeSBits(matrix.translateX, nTranslateBits);
- w.writeSBits(matrix.translateY, nTranslateBits);
-
- w.flushBits();
- }
-
- public override void defineButton2(DefineButton tag)
- {
- if (Debug)
- {
- debug.adjust = writer.Pos + 6;
- }
-
- int id = dict.add(tag);
- tagw.writeUI16(id);
- tagw.writeUBits(0, 7); // reserved
- tagw.writeBit(tag.trackAsMenu);
- int offsetPos = tagw.Pos;
- tagw.writeUI16(0); // actionOffset
-
- for (int i = 0; i < tag.buttonRecords.Length; i++)
- {
- encodeButtonRecord(tag.buttonRecords[i], tagw, tag.code);
- }
-
- tagw.writeUI8(0); // charEndFlag
-
- if (tag.condActions.Length > 0)
- {
- tagw.writeUI16at(offsetPos, tagw.Pos - offsetPos);
-
- for (int i = 0; i < tag.condActions.Length; i++)
- {
- bool isLast = i + 1 == tag.condActions.Length;
- encodeButtonCondAction(tag.condActions[i], tagw, isLast);
- }
- }
- encodeTag(tag);
-
- if (Debug)
- {
- debug.adjust = 0;
- }
- }
-
- private void encodeButtonCondAction(ButtonCondAction condAction, SwfEncoder w, bool last)
- {
- int pos = w.Pos;
- w.writeUI16(0);
-
- w.writeUBits(condAction.keyPress, 7);
- w.writeBit(condAction.overDownToIdle);
-
- w.writeBit(condAction.idleToOverDown);
- w.writeBit(condAction.outDownToIdle);
- w.writeBit(condAction.outDownToOverDown);
- w.writeBit(condAction.overDownToOutDown);
- w.writeBit(condAction.overDownToOverUp);
- w.writeBit(condAction.overUpToOverDown);
- w.writeBit(condAction.overUpToIdle);
- w.writeBit(condAction.idleToOverUp);
-
- new ActionEncoder(w, debug).encode(condAction.actionList);
- w.writeUI8(0); // end action byte
-
- if (!last)
- {
- w.writeUI16at(pos, w.Pos - pos);
- }
- }
-
- public override void defineButtonCxform(DefineButtonCxform tag)
- {
- int idref = dict.getId(tag.button);
- tagw.writeUI16(idref);
- encodeCxform(tag.colorTransform, tagw);
- encodeTag(tag);
- }
-
- private void encodeCxform(CXForm cxform, SwfEncoder w)
- {
-
- w.writeBit(cxform.hasAdd);
- w.writeBit(cxform.hasMult);
-
- int nbits = cxform.nbits();
- w.writeUBits(nbits, 4);
-
- if (cxform.hasMult)
- {
- w.writeSBits(cxform.redMultTerm, nbits);
- w.writeSBits(cxform.greenMultTerm, nbits);
- w.writeSBits(cxform.blueMultTerm, nbits);
- }
-
- if (cxform.hasAdd)
- {
- w.writeSBits(cxform.redAddTerm, nbits);
- w.writeSBits(cxform.greenAddTerm, nbits);
- w.writeSBits(cxform.blueAddTerm, nbits);
- }
-
- w.flushBits();
- }
-
- public override void defineButtonSound(DefineButtonSound tag)
- {
- int idref = dict.getId(tag.button);
- tagw.writeUI16(idref);
- if (tag.sound0 != null)
- {
- tagw.writeUI16(dict.getId(tag.sound0));
- encodeSoundInfo(tag.info0, tagw);
- }
- else
- {
- tagw.writeUI16(0);
- }
- if (tag.sound1 != null)
- {
- tagw.writeUI16(dict.getId(tag.sound1));
- encodeSoundInfo(tag.info1, tagw);
- }
- else
- {
- tagw.writeUI16(0);
- }
- if (tag.sound2 != null)
- {
- tagw.writeUI16(dict.getId(tag.sound2));
- encodeSoundInfo(tag.info2, tagw);
- }
- else
- {
- tagw.writeUI16(0);
- }
- if (tag.sound3 != null)
- {
- tagw.writeUI16(dict.getId(tag.sound3));
- encodeSoundInfo(tag.info3, tagw);
- }
- else
- {
- tagw.writeUI16(0);
- }
- encodeTag(tag);
- }
-
- private void encodeSoundInfo(SoundInfo info, SwfEncoder w)
- {
- w.writeUBits(0, 2); // reserved
- w.writeBit(info.syncStop);
- w.writeBit(info.syncNoMultiple);
- w.writeBit(info.records != null);
- w.writeBit(info.loopCount != SoundInfo.UNINITIALIZED);
- w.writeBit(info.outPoint != SoundInfo.UNINITIALIZED);
- w.writeBit(info.inPoint != SoundInfo.UNINITIALIZED);
-
- if (info.inPoint != SoundInfo.UNINITIALIZED)
- {
- w.write32((int) info.inPoint);
- }
- if (info.outPoint != SoundInfo.UNINITIALIZED)
- {
- w.write32((int) info.outPoint);
- }
- if (info.loopCount != SoundInfo.UNINITIALIZED)
- {
- w.writeUI16(info.loopCount);
- }
- if (info.records != null)
- {
- w.writeUI8(info.records.Length);
- for (int k = 0; k < info.records.Length; k++)
- {
- w.write64(info.records[k]);
- }
- }
- }
-
- public override void defineEditText(DefineEditText tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
- encodeRect(tag.bounds, tagw);
-
- tagw.writeBit(tag.hasText);
- tagw.writeBit(tag.wordWrap);
- tagw.writeBit(tag.multiline);
- tagw.writeBit(tag.password);
- tagw.writeBit(tag.readOnly);
- tagw.writeBit(tag.hasTextColor);
- tagw.writeBit(tag.hasMaxLength);
- tagw.writeBit(tag.hasFont);
-
- tagw.writeBit(false); // reserved
- tagw.writeBit(tag.autoSize);
- tagw.writeBit(tag.hasLayout);
- tagw.writeBit(tag.noSelect);
- tagw.writeBit(tag.border);
- tagw.writeBit(tag.wasStatic);
- tagw.writeBit(tag.html);
- tagw.writeBit(tag.useOutlines);
-
- tagw.flushBits();
-
- if (tag.hasFont)
- {
- int idref = dict.getId(tag.font);
- tagw.writeUI16(idref);
- tagw.writeUI16(tag.height);
- }
-
- if (tag.hasTextColor)
- {
- encodeRGBA(tag.color, tagw);
- }
-
- if (tag.hasMaxLength)
- {
- tagw.writeUI16(tag.maxLength);
- }
-
- if (tag.hasLayout)
- {
- tagw.writeUI8(tag.align);
- tagw.writeUI16(tag.leftMargin);
- tagw.writeUI16(tag.rightMargin);
- tagw.writeUI16(tag.ident);
- tagw.writeSI16(tag.leading); // see errata, leading is signed
- }
-
- tagw.writeString(tag.varName);
- if (tag.hasText)
- {
- tagw.writeString(tag.initialText);
- }
- encodeTag(tag);
- }
-
- public override void defineFont(DefineFont1 tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
-
- int count = tag.glyphShapeTable.Length;
-
- int offsetPos = tagw.Pos;
-
- // write offset placeholders
- for (int i = 0; i < count; i++)
- {
- tagw.writeUI16(0);
- }
-
- // now write glyphs and update the encoded offset table
- for (int i = 0; i < count; i++)
- {
- tagw.writeUI16at(offsetPos + 2 * i, tagw.Pos - offsetPos);
- encodeShape(tag.glyphShapeTable[i], tagw, flash.swf.TagValues_Fields.stagDefineShape3, 1, 0);
- }
-
- encodeTag(tag);
- }
-
- public virtual void encodeShape(Shape s, SwfEncoder w, int shape, int nFillStyles, int nLineStyles)
- {
- int[] numFillBits = new int[]{SwfEncoder.minBits(nFillStyles, 0)};
- int[] numLineBits = new int[]{SwfEncoder.minBits(nLineStyles, 0)};
-
- w.writeUBits(numFillBits[0], 4);
- w.writeUBits(numLineBits[0], 4);
-
- System.Collections.IEnumerator it = s.shapeRecords.GetEnumerator();
- //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
- while (it.MoveNext())
- {
- //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
- ShapeRecord record = (ShapeRecord) it.Current;
- if (record is StyleChangeRecord)
- {
- // style change
- w.writeBit(false);
- StyleChangeRecord change = (StyleChangeRecord) record;
- encodeStyleChangeRecord(w, change, numFillBits, numLineBits, shape);
- }
- else
- {
- // edge
- w.writeBit(true);
- EdgeRecord e = (EdgeRecord) record;
- bool straight = e is StraightEdgeRecord;
- w.writeBit(straight);
- int nbits = straight?calcBits((StraightEdgeRecord) e):calcBits((CurvedEdgeRecord) e);
- if (nbits < 2)
- nbits = 2;
- w.writeUBits(nbits - 2, 4);
- if (straight)
- {
- // line
- StraightEdgeRecord line = (StraightEdgeRecord) e;
- encodeStraightEdgeRecord(line, w, nbits);
- }
- else
- {
- // curve
- CurvedEdgeRecord curve = (CurvedEdgeRecord) e;
- w.writeSBits(curve.controlDeltaX, nbits);
- w.writeSBits(curve.controlDeltaY, nbits);
- w.writeSBits(curve.anchorDeltaX, nbits);
- w.writeSBits(curve.anchorDeltaY, nbits);
- }
- }
- }
-
- // endshaperecord
- w.writeUBits(0, 6);
-
- w.flushBits();
- }
-
- private int calcBits(StraightEdgeRecord edge)
- {
- return SwfEncoder.minBits(SwfEncoder.maxNum(edge.deltaX, edge.deltaY, 0, 0), 1);
- }
-
- private int calcBits(CurvedEdgeRecord edge)
- {
- return SwfEncoder.minBits(SwfEncoder.maxNum(edge.controlDeltaX, edge.controlDeltaY, edge.anchorDeltaX, edge.anchorDeltaY), 1);
- }
-
- private void encodeStraightEdgeRecord(StraightEdgeRecord line, SwfEncoder w, int nbits)
- {
- if (line.deltaX == 0)
- {
- w.writeUBits(1, 2); // vertical line
- w.writeSBits(line.deltaY, nbits);
- }
- else if (line.deltaY == 0)
- {
- w.writeUBits(0, 2); // horizontal line
- w.writeSBits(line.deltaX, nbits);
- }
- else
- {
- w.writeBit(true); // general line
- w.writeSBits(line.deltaX, nbits);
- w.writeSBits(line.deltaY, nbits);
- }
- }
-
- private void encodeStyleChangeRecord(SwfEncoder w, StyleChangeRecord s, int[] numFillBits, int[] numLineBits, int shape)
- {
- w.writeBit(s.stateNewStyles);
- w.writeBit(s.stateLineStyle);
- w.writeBit(s.stateFillStyle1);
- w.writeBit(s.stateFillStyle0);
- w.writeBit(s.stateMoveTo);
-
- if (s.stateMoveTo)
- {
- int moveBits = s.nMoveBits();
- w.writeUBits(moveBits, 5);
- w.writeSBits(s.moveDeltaX, moveBits);
- w.writeSBits(s.moveDeltaY, moveBits);
- }
-
- if (s.stateFillStyle0)
- {
- w.writeUBits(s.fillstyle0, numFillBits[0]);
- }
-
- if (s.stateFillStyle1)
- {
- w.writeUBits(s.fillstyle1, numFillBits[0]);
- }
-
- if (s.stateLineStyle)
- {
- w.writeUBits(s.linestyle, numLineBits[0]);
- }
-
- if (s.stateNewStyles)
- {
- w.flushBits();
-
- encodeFillstyles(s.fillstyles, w, shape);
- encodeLinestyles(s.linestyles, w, shape);
-
- numFillBits[0] = SwfEncoder.minBits(s.fillstyles.Count, 0);
- numLineBits[0] = SwfEncoder.minBits(s.linestyles.Count, 0);
- w.writeUBits(numFillBits[0], 4);
- w.writeUBits(numLineBits[0], 4);
- }
- }
-
- private void encodeLinestyles(System.Collections.ArrayList linestyles, SwfEncoder w, int shape)
- {
- int count = linestyles.Count;
- if (count > 0xFF)
- {
- w.writeUI8(0xFF);
- w.writeUI16(count);
- }
- else
- {
- w.writeUI8(count);
- }
-
- for (int i = 0; i < count; i++)
- {
- encodeLineStyle((LineStyle) linestyles[i], w, shape);
- }
- }
-
- private void encodeLineStyle(LineStyle lineStyle, SwfEncoder w, int shape)
- {
- w.writeUI16(lineStyle.width);
-
- if (shape == flash.swf.TagValues_Fields.stagDefineShape6)
- {
- w.writeUI16(lineStyle.flags);
- if (lineStyle.hasMiterJoint())
- w.writeUI16(lineStyle.miterLimit);
- }
-
- if (shape == flash.swf.TagValues_Fields.stagDefineShape6 && lineStyle.hasFillStyle())
- {
- encodeFillStyle(lineStyle.fillStyle, w, shape);
- }
- else if ((shape == flash.swf.TagValues_Fields.stagDefineShape3) || (shape == flash.swf.TagValues_Fields.stagDefineShape6))
- {
- encodeRGBA(lineStyle.color, w);
- }
- else
- {
- encodeRGB(lineStyle.color, w);
- }
- }
-
- private void encodeFillstyles(System.Collections.ArrayList fillstyles, SwfEncoder w, int shape)
- {
- int count = fillstyles.Count;
- if (count >= 0xFF)
- {
- w.writeUI8(0xFF);
- w.writeUI16(count);
- }
- else
- {
- w.writeUI8(count);
- }
-
- System.Collections.IEnumerator it = fillstyles.GetEnumerator();
- //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
- while (it.MoveNext())
- {
- //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
- FillStyle style = (FillStyle) it.Current;
- encodeFillStyle(style, w, shape);
- }
- }
-
- private void encodeFillStyle(FillStyle style, SwfEncoder w, int shape)
- {
- w.writeUI8(style.type);
- switch (style.type)
- {
-
- case FillStyle.FILL_SOLID: // 0x00
- if ((shape == flash.swf.TagValues_Fields.stagDefineShape3) || (shape == flash.swf.TagValues_Fields.stagDefineShape6))
- encodeRGBA(style.color, w);
- else
- encodeRGB(style.color, w);
- break;
-
- case FillStyle.FILL_GRADIENT:
- // 0x10 linear gradient fill
- case FillStyle.FILL_RADIAL_GRADIENT:
- // 0x12 radial gradient fill
- case FillStyle.FILL_FOCAL_RADIAL_GRADIENT: // 0x13 focal radial gradient fill
- encodeMatrix(style.matrix, w);
- encodeGradient(style.gradient, w, shape);
- break;
-
- case FillStyle.FILL_BITS:
- // 0x40 tiled bitmap fill
- case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_CLIP):
- // 0x41 clipped bitmap fill
- case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_NOSMOOTH):
- // 0x42 tiled non-smoothed fill
- case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_CLIP | FillStyle.FILL_BITS_NOSMOOTH): // 0x43 clipped non-smoothed fill
- w.writeUI16(dict.getId(style.bitmap));
- encodeMatrix(style.matrix, w);
- break;
- }
- }
-
- private void encodeGradient(Gradient gradient, SwfEncoder w, int shape)
- {
- w.writeUBits(gradient.spreadMode, 2);
- w.writeUBits(gradient.interpolationMode, 2);
- w.writeUBits(gradient.records.Length, 4);
- for (int i = 0; i < gradient.records.Length; i++)
- {
- encodeGradRecord(gradient.records[i], w, shape);
- }
- if (gradient is FocalGradient)
- {
- w.writeFixed8(((FocalGradient) gradient).focalPoint);
- }
- }
-
- private void encodeGradRecord(GradRecord record, SwfEncoder w, int shape)
- {
- w.writeUI8(record.ratio);
- if ((shape == flash.swf.TagValues_Fields.stagDefineShape3) || (shape == flash.swf.TagValues_Fields.stagDefineShape6))
- encodeRGBA(record.color, w);
- else
- encodeRGB(record.color, w);
- }
-
- public override void defineFont2(DefineFont2 tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
- int startPos = tagw.Pos;
- bool again;
-
- if (tag.code == flash.swf.TagValues_Fields.stagDefineFont3)
- {
- tag.wideCodes = true;
- }
-
- if (!tag.wideCodes)
- {
- for (int i = 0; i < tag.codeTable.Length; i++)
- {
- if (tag.codeTable[i] > 255)
- {
- tag.wideCodes = true;
- break;
- }
- }
- }
-
- //UPGRADE_NOTE: Label 'loop' was moved. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1014'"
- do
- {
- again = false;
- tagw.writeBit(tag.hasLayout);
- tagw.writeBit(tag.shiftJIS);
- tagw.writeBit(tag.smallText);
- tagw.writeBit(tag.ansi);
- tagw.writeBit(tag.wideOffsets);
- tagw.writeBit(tag.wideCodes);
- tagw.writeBit(tag.italic);
- tagw.writeBit(tag.bold);
- tagw.flushBits();
-
- tagw.writeUI8(tag.langCode);
-
- tagw.writeLengthString(tag.fontName);
- int count = tag.glyphShapeTable.Length;
-
- tagw.writeUI16(count);
- int offsetPos = tagw.Pos;
-
- // save space for the offset table
- if (tag.wideOffsets)
- {
- for (int i = 0; i < count; i++)
- {
- tagw.write32(0);
- }
- }
- else
- {
- for (int i = 0; i < count; i++)
- {
- tagw.writeUI16(0);
- }
- }
-
- //PJF: write placeholder for codeTableOffset, this will be changed after shapes encoded
- if (count > 0)
- {
- if (tag.wideOffsets)
- {
- tagw.write32(0);
- }
- else
- {
- tagw.writeUI16(0);
- }
- }
-
- for (int i = 0; i < count; i++)
- {
- // save offset to this glyph
- int offset = tagw.Pos - offsetPos;
- if (!tag.wideOffsets && offset > 65535)
- {
- again = true;
- tag.wideOffsets = true;
- tagw.Pos = startPos;
- //UPGRADE_NOTE: Labeled continue statement was changed to a goto statement. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1015'"
- goto loop;
- }
- if (tag.wideOffsets)
- tagw.write32at(offsetPos + 4 * i, offset);
- else
- tagw.writeUI16at(offsetPos + 2 * i, offset);
-
- encodeShape(tag.glyphShapeTable[i], tagw, flash.swf.TagValues_Fields.stagDefineShape3, 1, 0);
- }
-
- // update codeTableOffset
- int offset2 = tagw.Pos - offsetPos;
- if (!tag.wideOffsets && offset2 > 65535)
- {
- again = true;
- tag.wideOffsets = true;
- tagw.Pos = startPos;
- //UPGRADE_NOTE: Labeled continue statement was changed to a goto statement. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1015'"
- goto loop;
- }
- if (tag.wideOffsets)
- {
- tagw.write32at(offsetPos + 4 * count, offset2);
- }
- else
- {
- tagw.writeUI16at(offsetPos + 2 * count, offset2);
- }
-
- // now write the codetable
-
- if (tag.wideCodes)
- {
- for (int i = 0; i < tag.codeTable.Length; i++)
- {
- tagw.writeUI16(tag.codeTable[i]);
- }
- }
- else
- {
- for (int i = 0; i < tag.codeTable.Length; i++)
- {
- tagw.writeUI8(tag.codeTable[i]);
- }
- }
-
- if (tag.hasLayout)
- {
- tagw.writeSI16(tag.ascent);
- tagw.writeSI16(tag.descent);
- tagw.writeSI16(tag.leading);
-
- for (int i = 0; i < tag.advanceTable.Length; i++)
- {
- tagw.writeSI16(tag.advanceTable[i]);
- }
-
- for (int i = 0; i < tag.boundsTable.Length; i++)
- {
- encodeRect(tag.boundsTable[i], tagw);
- }
-
- tagw.writeUI16(tag.kerningTable.Length);
-
- for (int i = 0; i < tag.kerningTable.Length; i++)
- {
- if (!tag.wideCodes && ((tag.kerningTable[i].code1 > 255) || (tag.kerningTable[i].code2 > 255)))
- {
- again = true;
- tag.wideCodes = true;
- tagw.Pos = startPos;
- //UPGRADE_NOTE: Labeled continue statement was changed to a goto statement. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1015'"
- goto loop;
- }
-
- encodeKerningRecord(tag.kerningTable[i], tagw, tag.wideCodes);
- }
- }
- //UPGRADE_NOTE: Label 'loop' was moved. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1014'"
-loop: ;
- }
- while (again);
-
- encodeTag(tag);
- }
-
- public override void defineFont3(DefineFont3 tag)
- {
- defineFont2(tag);
- }
-
- public override void defineFont4(DefineFont4 tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
-
- tagw.writeUBits(0, 5); // reserved
- tagw.writeBit(tag.hasFontData);
- //tagw.writeBit(tag.smallText);
- tagw.writeBit(tag.italic);
- tagw.writeBit(tag.bold);
- tagw.flushBits();
-
- //tagw.writeUI8(tag.langCode);
- tagw.writeString(tag.fontName);
- if (tag.hasFontData)
- {
- tagw.write(tag.data);
- }
-
- encodeTag(tag);
- }
-
- public override void defineFontAlignZones(DefineFontAlignZones tag)
- {
- int fontID = dict.getId(tag.font);
- tagw.writeUI16(fontID);
- tagw.writeUBits(tag.csmTableHint, 2);
- tagw.writeUBits(0, 6); // reserved
- for (int i = 0; i < tag.zoneTable.Length; i++)
- {
- ZoneRecord record = tag.zoneTable[i];
- tagw.writeUI8(record.numZoneData);
- for (int j = 0; j < record.numZoneData; j++)
- {
- tagw.write32((int) record.zoneData[j]);
- }
- tagw.writeUI8(record.zoneMask);
- }
- encodeTag(tag);
- }
-
- public override void csmTextSettings(CSMTextSettings tag)
- {
- int textID = 0;
- if (tag.textReference != null)
- {
- textID = dict.getId(tag.textReference);
- }
- tagw.writeUI16(textID);
- tagw.writeUBits(tag.styleFlagsUseSaffron, 2);
- tagw.writeUBits(tag.gridFitType, 3);
- tagw.writeUBits(0, 3); // reserved
- // FIXME: thickness/sharpness should be written out as 32 bit IEEE Single Precision format in little Endian
- tagw.writeUBits((int) tag.thickness, 32);
- tagw.writeUBits((int) tag.sharpness, 32);
- tagw.writeUBits(0, 8); //reserved
-
- encodeTag(tag);
- }
-
- public override void defineFontName(DefineFontName tag)
- {
- int fontID = dict.getId(tag.font);
- tagw.writeUI16(fontID);
- if (tag.fontName != null)
- {
- tagw.writeString(tag.fontName);
- }
- else
- {
- tagw.writeString("");
- }
- if (tag.copyright != null)
- {
- tagw.writeString(tag.copyright);
- }
- else
- {
- tagw.writeString("");
- }
-
- encodeTag(tag);
- }
-
- private void encodeKerningRecord(KerningRecord kerningRecord, SwfEncoder w, bool wideCodes)
- {
- if (wideCodes)
- {
- w.writeUI16(kerningRecord.code1);
- w.writeUI16(kerningRecord.code2);
- }
- else
- {
- w.writeUI8(kerningRecord.code1);
- w.writeUI8(kerningRecord.code2);
- }
- w.writeUI16(kerningRecord.adjustment);
- }
-
- public override void defineFontInfo(DefineFontInfo tag)
- {
- int idref = dict.getId(tag.font);
- tagw.writeUI16(idref);
-
- tagw.writeLengthString(tag.name);
-
- tagw.writeUBits(0, 3); // reserved
- tagw.writeBit(tag.shiftJIS);
- tagw.writeBit(tag.ansi);
- tagw.writeBit(tag.italic);
- tagw.writeBit(tag.bold);
-
- if (tag.code == flash.swf.TagValues_Fields.stagDefineFontInfo2)
- {
- tagw.writeBit(tag.wideCodes = true);
- tagw.writeUI8(tag.langCode);
- }
- else
- {
- if (!tag.wideCodes)
- {
- for (int i = 0; i < tag.codeTable.Length; i++)
- {
- if (tag.codeTable[i] > 255)
- {
- tag.wideCodes = true;
- break;
- }
- }
- }
- tagw.writeBit(tag.wideCodes);
- }
-
- if (tag.wideCodes)
- {
- for (int i = 0; i < tag.codeTable.Length; i++)
- tagw.writeUI16(tag.codeTable[i]);
- }
- else
- {
- for (int i = 0; i < tag.codeTable.Length; i++)
- tagw.writeUI8(tag.codeTable[i]);
- }
- encodeTag(tag);
- }
-
- public override void defineFontInfo2(DefineFontInfo tag)
- {
- defineFontInfo(tag);
- }
-
- public override void defineMorphShape(DefineMorphShape tag)
- {
- defineMorphShape2(tag);
- }
-
- public override void defineMorphShape2(DefineMorphShape tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
- encodeRect(tag.startBounds, tagw);
- encodeRect(tag.endBounds, tagw);
- if (tag.code == flash.swf.TagValues_Fields.stagDefineMorphShape2)
- {
- encodeRect(tag.startEdgeBounds, tagw);
- encodeRect(tag.endEdgeBounds, tagw);
- tagw.writeUBits(tag.reserved, 6);
- tagw.writeUBits(tag.usesNonScalingStrokes?1:0, 1);
- tagw.writeUBits(tag.usesScalingStrokes?1:0, 1);
- }
- tagw.write32(0);
- int pos = tagw.Pos;
- encodeMorphFillstyles(tag.fillStyles, tagw, tag.code);
- encodeMorphLinestyles(tag.lineStyles, tagw, tag.code);
- encodeShape(tag.startEdges, tagw, flash.swf.TagValues_Fields.stagDefineShape3, tag.fillStyles.Length, tag.lineStyles.Length);
- tagw.write32at(pos - 4, tagw.Pos - pos);
- // end shape contains only edges, no style information
- encodeShape(tag.endEdges, tagw, flash.swf.TagValues_Fields.stagDefineShape3, 0, 0);
- encodeTag(tag);
- }
-
- private void encodeMorphFillstyles(MorphFillStyle[] fillStyles, SwfEncoder w, int code)
- {
- int count = fillStyles.Length;
- if (count >= 0xFF)
- {
- w.writeUI8(0xFF);
- w.writeUI16(count);
- }
- else
- {
- w.writeUI8(count);
- }
-
- for (int i = 0; i < count; i++)
- {
- encodeMorphFillstyle(fillStyles[i], w, code);
- }
- }
-
- private void encodeMorphFillstyle(MorphFillStyle style, SwfEncoder w, int code)
- {
- w.writeUI8(style.type);
- switch (style.type)
- {
-
- case FillStyle.FILL_SOLID: // 0x00
- encodeRGBA(style.startColor, w);
- encodeRGBA(style.endColor, w);
- break;
-
- case FillStyle.FILL_GRADIENT:
- // 0x10 linear gradient fill
- case FillStyle.FILL_RADIAL_GRADIENT:
- // 0x12 radial gradient fill
- case FillStyle.FILL_FOCAL_RADIAL_GRADIENT: // 0x13 focal radial gradient fill
- encodeMatrix(style.startGradientMatrix, w);
- encodeMatrix(style.endGradientMatrix, w);
- encodeMorphGradient(style.gradRecords, w);
- if (style.type == FillStyle.FILL_FOCAL_RADIAL_GRADIENT && code == flash.swf.TagValues_Fields.stagDefineMorphShape2)
- {
- w.writeSI16(style.ratio1);
- w.writeSI16(style.ratio2);
- }
- break;
-
- case FillStyle.FILL_BITS:
- // 0x40 tiled bitmap fill
- case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_CLIP):
- // 0x41 clipped bitmap fill
- case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_NOSMOOTH):
- // 0x42 tiled non-smoothed fill
- case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_CLIP | FillStyle.FILL_BITS_NOSMOOTH): // 0x43 clipped non-smoothed fill
- w.writeUI16(dict.getId(style.bitmap));
- encodeMatrix(style.startBitmapMatrix, w);
- encodeMatrix(style.endBitmapMatrix, w);
- break;
-
- default:
- assert(false);
- //throw new IOException("unrecognized fill style type: " + style.type);
- break;
-
- }
- }
-
- private void encodeMorphGradient(MorphGradRecord[] gradRecords, SwfEncoder w)
- {
- w.writeUI8(gradRecords.Length);
- for (int i = 0; i < gradRecords.Length; i++)
- {
- MorphGradRecord record = gradRecords[i];
- w.writeUI8(record.startRatio);
- encodeRGBA(record.startColor, w);
- w.writeUI8(record.endRatio);
- encodeRGBA(record.endColor, w);
- }
- }
-
- private void encodeMorphLinestyles(MorphLineStyle[] lineStyles, SwfEncoder w, int code)
- {
- if (lineStyles.Length >= 0xFF)
- {
- w.writeUI8(0xFF);
- w.writeUI16(lineStyles.Length);
- }
- else
- {
- w.writeUI8(lineStyles.Length);
- }
-
- for (int i = 0; i < lineStyles.Length; i++)
- {
- MorphLineStyle style = lineStyles[i];
- w.writeUI16(style.startWidth);
- w.writeUI16(style.endWidth);
- if (code == flash.swf.TagValues_Fields.stagDefineMorphShape2)
- {
- w.writeUBits(style.startCapsStyle, 2);
- w.writeUBits(style.jointStyle, 2);
- w.writeBit(style.hasFill);
- w.writeBit(style.noHScale);
- w.writeBit(style.noVScale);
- w.writeBit(style.pixelHinting);
- w.writeUBits(0, 5); // reserved
- w.writeBit(style.noClose);
- w.writeUBits(style.endCapsStyle, 2);
- if (style.jointStyle == 2)
- {
- w.writeUI16(style.miterLimit);
- }
- }
- if (!style.hasFill)
- {
- encodeRGBA(style.startColor, w);
- encodeRGBA(style.endColor, w);
- }
- if (style.hasFill)
- {
- encodeMorphFillstyle(style.fillType, w, code);
- }
- }
- }
-
- public override void defineShape(DefineShape tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
- encodeRect(tag.bounds, tagw);
- if (tag.code == flash.swf.TagValues_Fields.stagDefineShape6)
- {
- encodeRect(tag.edgeBounds, tagw);
- tagw.writeUBits(0, 6);
- tagw.writeBit(tag.usesNonScalingStrokes);
- tagw.writeBit(tag.usesScalingStrokes);
- }
- encodeShapeWithStyle(tag.shapeWithStyle, tagw, tag.code);
- encodeTag(tag);
- }
-
- private void encodeShapeWithStyle(ShapeWithStyle shapeWithStyle, SwfEncoder w, int shape)
- {
- encodeFillstyles(shapeWithStyle.fillstyles, w, shape);
- encodeLinestyles(shapeWithStyle.linestyles, w, shape);
-
- encodeShape(shapeWithStyle, w, shape, shapeWithStyle.fillstyles.Count, shapeWithStyle.linestyles.Count);
- }
-
- public override void defineShape2(DefineShape tag)
- {
- defineShape(tag);
- }
-
- public override void defineShape3(DefineShape tag)
- {
- defineShape(tag);
- }
-
- public override void defineShape6(DefineShape tag)
- {
- defineShape(tag);
- }
-
- public override void defineSound(DefineSound tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
- tagw.writeUBits(tag.format, 4);
- tagw.writeUBits(tag.rate, 2);
- tagw.writeUBits(tag.size, 1);
- tagw.writeUBits(tag.type, 1);
- tagw.write32((int) tag.sampleCount);
- tagw.write(tag.data);
- encodeTag(tag);
- }
-
- public override void defineSprite(DefineSprite tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
- tagw.writeUI16(tag.framecount);
-
- if (Debug)
- {
- debug.adjust = writer.Pos + 6;
- }
-
- // save frame count
- int oldFrames = frames;
- frames = 0;
-
- // save the movie writer, and push a new writer
- SwfEncoder oldWriter = writer;
- writer = tagw;
- tagw = createEncoder(SwfVersion);
-
- // write sprite tags
- System.Collections.IList tags = tag.tagList.tags;
- int size = tags.Count;
- for (int i = 0; i < size; i++)
- {
- Tag t = (Tag) tags[i];
- if (!(t is DefineTag))
- t.visit(this);
- }
-
- // terminate with end marker
- writer.writeUI16(0);
-
- // update frame count
- writer.writeUI16at(2, frames);
-
- // restore writers
- tagw = writer;
- writer = oldWriter;
- frames = oldFrames;
-
- if (Debug)
- {
- debug.adjust = 0;
- }
-
- encodeTag(tag);
- }
-
- public override void defineText(DefineText tag)
- {
- encodeDefineText(tag, tagw, tag.code);
- encodeTag(tag);
- }
-
- private void encodeDefineText(DefineText tag, SwfEncoder w, int type)
- {
- int id = dict.add(tag);
- w.writeUI16(id);
- encodeRect(tag.bounds, w);
- encodeMatrix(tag.matrix, w);
- int length = tag.records.Count;
-
- // compute necessary bit width
- int glyphBits = 0;
- int advanceBits = 0;
- for (int i = 0; i < length; i++)
- {
- TextRecord tr = (TextRecord) tag.records[i];
-
- for (int j = 0; j < tr.entries.Length; j++)
- {
- GlyphEntry entry = tr.entries[j];
-
- while (entry.Index > (1 << glyphBits))
- glyphBits++;
- while (System.Math.Abs(entry.advance) > (1 << advanceBits))
- advanceBits++;
- }
- }
-
- // increment to get from bit index to bit count.
- ++glyphBits;
- ++advanceBits;
-
- w.writeUI8(glyphBits);
- w.writeUI8(++advanceBits); // add one extra bit because advances are signed
-
- for (int i = 0; i < length; i++)
- {
- TextRecord record = (TextRecord) tag.records[i];
- encodeTextRecord(record, w, type, glyphBits, advanceBits);
- }
-
- w.writeUI8(0);
- }
-
- private void encodeFilterList(System.Collections.IList filters, SwfEncoder w)
- {
- int count = filters.Count;
- w.writeUI8(count);
- //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
- for (System.Collections.IEnumerator it = filters.GetEnumerator(); it.MoveNext(); )
- {
- //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
- Filter f = (Filter) it.Current;
- w.writeUI8(f.getID());
- // I've never quite understood why the serialization code isn't in the tags themselves..
- switch (f.getID())
- {
-
- case DropShadowFilter.ID: encodeDropShadowFilter(w, (DropShadowFilter) f); break;
-
- case BlurFilter.ID: encodeBlurFilter(w, (BlurFilter) f); break;
-
- case ConvolutionFilter.ID: encodeConvolutionFilter(w, (ConvolutionFilter) f); break;
-
- case GlowFilter.ID: encodeGlowFilter(w, (GlowFilter) f); break;
-
- case BevelFilter.ID: encodeBevelFilter(w, (BevelFilter) f); break;
-
- case ColorMatrixFilter.ID: encodeColorMatrixFilter(w, (ColorMatrixFilter) f); break;
-
- case GradientGlowFilter.ID: encodeGradientGlowFilter(w, (GradientGlowFilter) f); break;
-
- case GradientBevelFilter.ID: encodeGradientBevelFilter(w, (GradientBevelFilter) f); break;
- }
- }
- }
-
- private void encodeDropShadowFilter(SwfEncoder w, DropShadowFilter f)
- {
- encodeRGBA(f.color, w);
- w.write32(f.blurX);
- w.write32(f.blurY);
- w.write32(f.angle);
- w.write32(f.distance);
- w.writeUI16(f.strength);
- w.writeUI8(f.flags);
- }
-
- private void encodeBlurFilter(SwfEncoder w, BlurFilter f)
- {
- w.write32(f.blurX);
- w.write32(f.blurY);
- w.writeUI8(f.passes);
- }
- private void encodeColorMatrixFilter(SwfEncoder w, ColorMatrixFilter f)
- {
- for (int i = 0; i < 20; ++i)
- {
- w.writeFloat(f.values[i]);
- }
- }
- private void encodeConvolutionFilter(SwfEncoder w, ConvolutionFilter f)
- {
- w.writeUI8(f.matrixX);
- w.writeUI8(f.matrixY);
- w.writeFloat(f.divisor);
- w.writeFloat(f.bias);
- for (int i = 0; i < f.matrix.Length; ++i)
- w.writeFloat(f.matrix[i]);
- w.writeUI8(f.flags);
- }
- private void encodeGlowFilter(SwfEncoder w, GlowFilter f)
- {
- encodeRGBA(f.color, w);
- w.write32(f.blurX);
- w.write32(f.blurY);
- w.writeUI16(f.strength);
- w.writeUI8(f.flags);
- }
- private void encodeBevelFilter(SwfEncoder w, BevelFilter f)
- {
- encodeRGBA(f.shadowColor, w);
- encodeRGBA(f.highlightColor, w);
- w.write32(f.blurX);
- w.write32(f.blurY);
- w.write32(f.angle);
- w.write32(f.distance);
- w.writeUI16(f.strength);
- w.writeUI8(f.flags);
- }
-
- private void encodeGradientGlowFilter(SwfEncoder w, GradientGlowFilter f)
- {
- w.writeUI8(f.numcolors);
- for (int i = 0; i < f.numcolors; ++i)
- encodeRGBA(f.gradientColors[i], w);
- for (int i = 0; i < f.numcolors; ++i)
- w.writeUI8(f.gradientRatio[i]);
- //w.write32( f.color );
- w.write32(f.blurX);
- w.write32(f.blurY);
- w.write32(f.angle);
- w.write32(f.distance);
- w.writeUI16(f.strength);
- w.writeUI8(f.flags);
- }
- private void encodeGradientBevelFilter(SwfEncoder w, GradientBevelFilter f)
- {
- w.writeUI8(f.numcolors);
- for (int i = 0; i < f.numcolors; ++i)
- encodeRGBA(f.gradientColors[i], w);
- for (int i = 0; i < f.numcolors; ++i)
- w.writeUI8(f.gradientRatio[i]);
-
- // w.write32( f.shadowColor );
- // w.write32( f.highlightColor );
- w.write32(f.blurX);
- w.write32(f.blurY);
- w.write32(f.angle);
- w.write32(f.distance);
- w.writeUI16(f.strength);
- w.writeUI8(f.flags);
- }
-
- private void encodeTextRecord(TextRecord record, SwfEncoder w, int type, int glyphBits, int advanceBits)
- {
- w.writeUI8(record.flags);
-
- if (record.hasFont())
- {
- w.writeUI16(dict.getId(record.font));
- }
-
- if (record.hasColor())
- {
- if (type == flash.swf.TagValues_Fields.stagDefineText2)
- encodeRGBA(record.color, w);
- else
- encodeRGB(record.color, w);
- }
-
- if (record.hasX())
- {
- w.writeSI16(record.xOffset);
- }
-
- if (record.hasY())
- {
- w.writeSI16(record.yOffset);
- }
-
- if (record.hasHeight())
- {
- w.writeUI16(record.height);
- }
-
- w.writeUI8(record.entries.Length);
-
- for (int i = 0; i < record.entries.Length; i++)
- {
- w.writeUBits(record.entries[i].Index, glyphBits);
- w.writeSBits(record.entries[i].advance, advanceBits);
- }
- w.flushBits();
- }
-
- public override void defineText2(DefineText tag)
- {
- defineText(tag);
- }
-
- public override void defineVideoStream(DefineVideoStream tag)
- {
- int id = dict.add(tag);
- tagw.writeUI16(id);
- tagw.writeUI16(tag.numFrames);
- tagw.writeUI16(tag.width);
- tagw.writeUI16(tag.height);
-
- tagw.writeUBits(0, 4); // reserved
- tagw.writeUBits(tag.deblocking, 3);
- tagw.writeBit(tag.smoothing);
-
- tagw.writeUI8(tag.codecID);
- encodeTag(tag);
- }
-
- public override void doAction(DoAction tag)
- {
- int adjust = 0;
- if (Debug)
- {
- adjust = writer.Pos + 6;
- debug.adjust += adjust;
- }
-
- new ActionEncoder(tagw, debug).encode(tag.actionList);
- tagw.writeUI8(0);
- encodeTag(tag);
-
- if (Debug)
- {
- debug.adjust -= adjust;
- }
- }
-
- public override void doInitAction(DoInitAction tag)
- {
- int adjust = 0;
- if (Debug)
- {
- adjust = writer.Pos + 6;
- debug.adjust += adjust;
- }
-
- int idref = dict.getId(tag.sprite);
- tagw.writeUI16(idref);
- new ActionEncoder(tagw, debug).encode(tag.actionList);
- tagw.writeUI8(0);
- encodeTag(tag);
-
- if (Debug)
- {
- debug.adjust -= adjust;
- }
- }
-
- public override void enableDebugger(EnableDebugger tag)
- {
- tagw.writeString(tag.password);
- encodeTag(tag);
- }
-
- public override void enableDebugger2(EnableDebugger tag)
- {
- // This corresponds to the constant used in the player,
- // core/splay.cpp, in ScriptThread::EnableDebugger().
- tagw.writeUI16(0x1975);
- tagw.writeString(tag.password);
- encodeTag(tag);
- }
-
- public override void exportAssets(ExportAssets tag)
- {
- tagw.writeUI16(tag.exports.Count);
- System.Collections.IEnumerator it = tag.exports.GetEnumerator();
- //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
- while (it.MoveNext())
- {
- //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
- DefineTag ref_Renamed = (DefineTag) it.Current;
- int idref = dict.getId(ref_Renamed);
- tagw.writeUI16(idref);
- assert(ref_Renamed.name != null); // exported symbols must have names
- tagw.writeString(ref_Renamed.name);
- dict.addName(ref_Renamed, ref_Renamed.name);
- }
- encodeTag(tag);
- }
-
- public override void symbolClass(SymbolClass tag)
- {
- tagw.writeUI16(tag.class2tag.Count + (tag.topLevelClass != null?1:0));
- //UPGRADE_TODO: Method 'java.util.Map.entrySet' was converted to 'SupportClass.HashSetSupport' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilMapentrySet'"
- System.Collections.IEnumerator it = new SupportClass.HashSetSupport(tag.class2tag).GetEnumerator();
- //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
- while (it.MoveNext())
- {
- //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
- System.Collections.DictionaryEntry e = (System.Collections.DictionaryEntry) it.Current;
- System.String name = (System.String) e.Key;
- DefineTag ref_Renamed = (DefineTag) e.Value;
-
- int idref = dict.getId(ref_Renamed);
- tagw.writeUI16(idref);
- tagw.writeString(name);
- }
- if (tag.topLevelClass != null)
- {
- tagw.writeUI16(0);
- tagw.writeString(tag.topLevelClass);
- }
- encodeTag(tag);
- }
-
- public override void frameLabel(FrameLabel tag)
- {
- tagw.writeString(tag.label);
- if (tag.anchor && SwfVersion >= 6)
- {
- tagw.writeUI8(1);
- }
- encodeTag(tag);
- }
-
- public override void importAssets(ImportAssets tag)
- {
- tagw.writeString(tag.url);
- if (tag.code == flash.swf.TagValues_Fields.stagImportAssets2)
- {
- tagw.writeUI8(tag.downloadNow?1:0);
- tagw.writeUI8(tag.SHA1 != null?1:0);
- if (tag.SHA1 != null)
- {
- tagw.write(tag.SHA1);
- }
- }
- tagw.writeUI16(tag.importRecords.Count);
- System.Collections.IEnumerator it = tag.importRecords.GetEnumerator();
- //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
- while (it.MoveNext())
- {
- //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
- ImportRecord record = (ImportRecord) it.Current;
- int id = dict.add(record);
- tagw.writeUI16(id);
- tagw.writeString(record.name);
- }
- encodeTag(tag);
- }
-
- public override void importAssets2(ImportAssets tag)
- {
- importAssets(tag);
- }
-
- public override void jpegTables(GenericTag tag)
- {
- encodeTagHeader(tag.code, tag.data.Length, false);
- writer.write(tag.data);
- }
-
- public override void placeObject(PlaceObject tag)
- {
- int idref = dict.getId(tag.ref_Renamed);
- tagw.writeUI16(idref);
- tagw.writeUI16(tag.depth);
- encodeMatrix(tag.matrix, tagw);
- if (tag.colorTransform != null)
- {
- encodeCxform(tag.colorTransform, tagw);
- }
- encodeTag(tag);
- }
-
- public override void placeObject2(PlaceObject tag)
- {
- placeObject23(tag);
- }
-
- public override void placeObject3(PlaceObject tag)
- {
- placeObject23(tag);
- }
-
- public virtual void placeObject23(PlaceObject tag)
- {
- tagw.writeUI8(tag.flags);
- if (tag.code == flash.swf.TagValues_Fields.stagPlaceObject3)
- {
- tagw.writeUI8(tag.flags2);
- }
- tagw.writeUI16(tag.depth);
- if (tag.hasClassName())
- {
- tagw.writeString(tag.className);
- }
- if (tag.hasCharID())
- {
- int idref = dict.getId(tag.ref_Renamed);
- tagw.writeUI16(idref);
- }
- if (tag.hasMatrix())
- {
- encodeMatrix(tag.matrix, tagw);
- }
- if (tag.hasCxform())
- {
- // ed 5/22/03 the SWF 6 file format spec says this should be a CXFORM, but
- // the spec is wrong. the player expects a CXFORMA.
- encodeCxforma(((CXFormWithAlpha) tag.colorTransform), tagw);
- }
- if (tag.hasRatio())
- {
- tagw.writeUI16(tag.ratio);
- }
- if (tag.hasName())
- {
- tagw.writeString(tag.name);
- }
- if (tag.hasClipDepth())
- {
- tagw.writeUI16(tag.clipDepth);
- }
- if (tag.code == flash.swf.TagValues_Fields.stagPlaceObject3)
- {
- if (tag.hasFilterList())
- {
- encodeFilterList(tag.filters, tagw);
- }
- if (tag.hasBlendMode())
- {
- tagw.writeUI8(tag.blendMode);
- }
- }
- if (tag.hasClipAction())
- {
- int adjust = 0;
- if (Debug)
- {
- adjust = writer.Pos + 6;
- debug.adjust += adjust;
- }
- new ActionEncoder(tagw, debug).encodeClipActions(tag.clipActions);
- if (Debug)
- {
- debug.adjust -= adjust;
- }
- }
- encodeTag(tag);
- }
-
- public override void protect(GenericTag tag)
- {
- if (tag.data != null)
- {
- encodeTagHeader(tag.code, tag.data.Length, false);
- writer.write(tag.data);
- }
- else
- {
- encodeTagHeader(tag.code, 0, false);
- }
- }
-
- public override void removeObject(RemoveObject tag)
- {
- encodeTagHeader(tag.code, 4, false);
- int idref = dict.getId(tag.ref_Renamed);
- writer.writeUI16(idref);
- writer.writeUI16(tag.depth);
- }
-
- public override void removeObject2(RemoveObject tag)
- {
- encodeTagHeader(tag.code, 2, false);
- writer.writeUI16(tag.depth);
- }
-
- public override void showFrame(ShowFrame tag)
- {
- encodeTagHeader(tag.code, 0, false);
- frames++;
- }
-
- public override void soundStreamBlock(GenericTag tag)
- {
- encodeTagHeader(tag.code, tag.data.Length, false);
- writer.write(tag.data);
- }
-
- public override void soundStreamHead(SoundStreamHead tag)
- {
- int length = 4;
-
- // we need to add two bytes for an extra SI16 (latencySeek)
- if (tag.compression == SoundStreamHead.sndCompressMP3)
- {
- length += 2;
- }
-
- encodeTagHeader(tag.code, length, false);
-
- // 1 byte
- writer.writeUBits(0, 4); // reserved
- writer.writeUBits(tag.playbackRate, 2);
- writer.writeUBits(tag.playbackSize, 1);
- writer.writeUBits(tag.playbackType, 1);
-
- // 1 byte
- writer.writeUBits(tag.compression, 4);
- writer.writeUBits(tag.streamRate, 2);
- writer.writeUBits(tag.streamSize, 1);
- writer.writeUBits(tag.streamType, 1);
-
- // 2 bytes
- writer.writeUI16(tag.streamSampleCount);
-
- if (tag.compression == SoundStreamHead.sndCompressMP3)
- {
- // 2 bytes
- writer.writeSI16(tag.latencySeek);
- }
- }
-
- public override void soundStreamHead2(SoundStreamHead tag)
- {
- soundStreamHead(tag);
- }
-
- public override void startSound(StartSound tag)
- {
- int idref = dict.getId(tag.sound);
- tagw.writeUI16(idref);
- encodeSoundInfo(tag.soundInfo, tagw);
- encodeTag(tag);
- }
-
- public override void videoFrame(VideoFrame tag)
- {
- encodeTagHeader(tag.code, 4 + tag.videoData.Length, false);
- int idref = dict.getId(tag.stream);
- writer.writeUI16(idref);
- writer.writeUI16(tag.frameNum);
- writer.write(tag.videoData);
- }
-
- public override void defineSceneAndFrameLabelData(DefineSceneAndFrameLabelData tag)
- {
- encodeTagHeader(tag.code, tag.data.Length, false);
- writer.write(tag.data);
- }
-
- public override void doABC(DoABC tag)
- {
- if (tag.code == flash.swf.TagValues_Fields.stagDoABC2)
- {
- encodeTagHeader(tag.code, 4 + tag.name.Length + 1 + tag.abc.Length, false);
- writer.write32(tag.flag);
- writer.writeString(tag.name);
- }
- else
- {
- encodeTagHeader(tag.code, tag.abc.Length, false);
- }
-
- writer.write(tag.abc);
- }
-
- public override void unknown(GenericTag tag)
- {
- encodeTagHeader(tag.code, tag.data.Length, false);
- writer.write(tag.data);
- }
-
- public virtual sbyte[] toByteArray()
- {
- //TODO this could be improved, tricky bit is that writeTo is not trivial
- // and has the side effect of compressing (meaning the writer.size()
- // may be larger than necessary)
- System.IO.MemoryStream out_Renamed = new System.IO.MemoryStream(writer.Length);
- writeTo(out_Renamed);
- return SupportClass.ToSByteArray(out_Renamed.ToArray());
- }
-
- public override void scriptLimits(ScriptLimits tag)
- {
- tagw.writeUI16(tag.scriptRecursionLimit);
- tagw.writeUI16(tag.scriptTimeLimit);
- encodeTag(tag);
- }
- }
+////////////////////////////////////////////////////////////////////////////////
+//
+// ADOBE SYSTEMS INCORPORATED
+// Copyright 2003-2007 Adobe Systems Incorporated
+// All Rights Reserved.
+//
+// NOTICE: Adobe permits you to use, modify, and distribute this file
+// in accordance with the terms of the license agreement accompanying it.
+//
+////////////////////////////////////////////////////////////////////////////////
+using System;
+using flash.swf.tags;
+using ButtonCondAction = flash.swf.types.ButtonCondAction;
+using ButtonRecord = flash.swf.types.ButtonRecord;
+using CXForm = flash.swf.types.CXForm;
+using CXFormWithAlpha = flash.swf.types.CXFormWithAlpha;
+using CurvedEdgeRecord = flash.swf.types.CurvedEdgeRecord;
+using EdgeRecord = flash.swf.types.EdgeRecord;
+using FillStyle = flash.swf.types.FillStyle;
+using GlyphEntry = flash.swf.types.GlyphEntry;
+using GradRecord = flash.swf.types.GradRecord;
+using ImportRecord = flash.swf.types.ImportRecord;
+using KerningRecord = flash.swf.types.KerningRecord;
+using LineStyle = flash.swf.types.LineStyle;
+using MD5 = flash.swf.types.MD5;
+using Matrix = flash.swf.types.Matrix;
+using MorphFillStyle = flash.swf.types.MorphFillStyle;
+using MorphGradRecord = flash.swf.types.MorphGradRecord;
+using MorphLineStyle = flash.swf.types.MorphLineStyle;
+using Rect = flash.swf.types.Rect;
+using Shape = flash.swf.types.Shape;
+using ShapeRecord = flash.swf.types.ShapeRecord;
+using ShapeWithStyle = flash.swf.types.ShapeWithStyle;
+using SoundInfo = flash.swf.types.SoundInfo;
+using StraightEdgeRecord = flash.swf.types.StraightEdgeRecord;
+using StyleChangeRecord = flash.swf.types.StyleChangeRecord;
+using TextRecord = flash.swf.types.TextRecord;
+using Filter = flash.swf.types.Filter;
+using DropShadowFilter = flash.swf.types.DropShadowFilter;
+using BlurFilter = flash.swf.types.BlurFilter;
+using ColorMatrixFilter = flash.swf.types.ColorMatrixFilter;
+using GlowFilter = flash.swf.types.GlowFilter;
+using ConvolutionFilter = flash.swf.types.ConvolutionFilter;
+using BevelFilter = flash.swf.types.BevelFilter;
+using GradientGlowFilter = flash.swf.types.GradientGlowFilter;
+using GradientBevelFilter = flash.swf.types.GradientBevelFilter;
+using Gradient = flash.swf.types.Gradient;
+using FocalGradient = flash.swf.types.FocalGradient;
+namespace flash.swf
+{
+
+ public class TagEncoder:TagHandler, TagValues
+ {
+ virtual public int Pos
+ {
+ get
+ {
+ return writer.Pos;
+ }
+
+ }
+ virtual protected internal int SwfVersion
+ {
+ get
+ {
+ return header_Renamed_Field.version;
+ }
+
+ }
+ virtual protected internal int FrameRate
+ {
+ get
+ {
+ return header_Renamed_Field.rate;
+ }
+
+ }
+ virtual public Dictionary EncoderDictionary
+ {
+ set
+ {
+ assert((this.dict == null) || (this.dict.ids.Count == 0));
+ this.dict = value;
+ }
+
+ }
+ virtual public Dictionary Dictionary
+ {
+ get
+ {
+ return dict;
+ }
+
+ }
+ virtual public bool Debug
+ {
+ get
+ {
+ return debug != null;
+ }
+
+ }
+ virtual public int Width
+ {
+ get
+ {
+ return width / 20;
+ }
+
+ }
+ virtual public int Height
+ {
+ get
+ {
+ return height / 20;
+ }
+
+ }
+ virtual public System.String MainDebugScript
+ {
+ set
+ {
+ debug.MainDebugScript = value;
+ }
+
+ }
+ override public SetBackgroundColor BackgroundColor
+ {
+ set
+ {
+ encodeTagHeader(value.code, 3, false);
+ encodeRGB(value.color, writer);
+ }
+
+ }
+ override public SetTabIndex TabIndex
+ {
+ set
+ {
+ tagw.writeUI16(value.depth);
+ tagw.writeUI16(value.index);
+ encodeTag(value);
+ }
+
+ }
+ // changed from private to protected to support Flash Authoring - jkamerer 2007.07.30
+ protected internal SwfEncoder writer;
+ private SwfEncoder tagw;
+ private int width;
+ private int height;
+ private int frames;
+ private int framecountPos;
+ private DebugEncoder debug;
+ private Header header_Renamed_Field;
+
+ protected internal Dictionary dict;
+ private int uuidOffset;
+
+ public TagEncoder()
+ {
+ dict = new Dictionary();
+ }
+
+ public TagEncoder(Dictionary dict)
+ {
+ this.dict = dict;
+ }
+
+ public override void productInfo(ProductInfo tag)
+ {
+ tagw.write32(tag.Product);
+ tagw.write32(tag.Edition);
+ tagw.write(new sbyte[]{tag.MajorVersion, tag.MinorVersion});
+ tagw.write64(tag.Build);
+ tagw.write64(tag.CompileDate);
+ encodeTag(tag);
+ }
+
+ public override void fileAttributes(FileAttributes tag)
+ {
+ tagw.writeUBits(0, 3);
+ tagw.writeBit(tag.hasMetadata);
+ tagw.writeBit(tag.actionScript3);
+ tagw.writeBit(tag.suppressCrossDomainCaching);
+ tagw.writeBit(tag.swfRelativeUrls);
+ tagw.writeBit(tag.useNetwork);
+ tagw.writeUBits(0, 24);
+ encodeTag(tag);
+ }
+
+ public override void metadata(Metadata tag)
+ {
+ tagw.writeString(tag.xml);
+ encodeTag(tag);
+ }
+
+ protected internal virtual SwfEncoder createEncoder(int swfVersion)
+ {
+ return new SwfEncoder(swfVersion);
+ }
+
+ public override void header(Header header)
+ {
+ // get some header properties we need to know
+ int swfVersion = header.version;
+ this.header_Renamed_Field = header;
+ this.writer = createEncoder(swfVersion);
+ this.tagw = createEncoder(swfVersion);
+ width = header.size.Width;
+ height = header.size.Height;
+ frames = 0;
+
+ // write the header
+ writer.writeUI8(header.compressed?'C':'F');
+ writer.writeUI8('W');
+ writer.writeUI8('S');
+ writer.writeUI8(header.version);
+ writer.write32((int) header.length);
+ if (header.compressed)
+ {
+ writer.markComp();
+ }
+ encodeRect(header.size, writer);
+ writer.writeUI8(header.rate >> 8);
+ writer.writeUI8(header.rate & 255);
+ framecountPos = writer.Pos;
+ writer.writeUI16(header.framecount);
+ }
+
+ public override void finish()
+ {
+ // write end marker
+ writer.writeUI16(0);
+
+ // update the length
+ writer.write32at(4, writer.Pos);
+
+ // update the frame count
+ writer.writeUI16at(framecountPos, frames);
+
+ if (debug != null)
+ {
+ // compute a crc and use it for the debug id. that way it
+ // is wholly dependent on the bytes in the SWF and not some
+ // outside value. If any of the bytes are different,
+ // then the UUID will be different.
+ sbyte[] md5 = MD5.getDigest(writer.ByteArray, writer.Length);
+ writer.writeAt(uuidOffset, md5);
+ debug.updateUUID(md5);
+ }
+ }
+
+ public virtual void writeTo(System.IO.Stream out_Renamed)
+ {
+ writer.WriteTo(out_Renamed);
+ }
+
+
+ public virtual void writeDebugTo(System.IO.Stream out_Renamed)
+ {
+ debug.writeTo(out_Renamed);
+ }
+
+ public virtual void encodeRect(Rect r, SwfEncoder w)
+ {
+ int nBits = r.nbits();
+ w.writeUBits(nBits, 5);
+ w.writeSBits(r.xMin, nBits);
+ w.writeSBits(r.xMax, nBits);
+ w.writeSBits(r.yMin, nBits);
+ w.writeSBits(r.yMax, nBits);
+ w.flushBits();
+ }
+
+ public override void debugID(DebugID tag)
+ {
+ encodeTagHeader(tag.code, tag.uuid.bytes.Length, false);
+ uuidOffset = writer.Pos;
+ writer.write(tag.uuid.bytes);
+
+ debug = new DebugEncoder();
+ debug.header(SwfVersion);
+ debug.uuid(tag.uuid);
+ }
+
+ private void encodeTag(Tag tag)
+ {
+ try
+ {
+ tagw.compress();
+ encodeTagHeader(tag.code, tagw.Pos, isLongHeader(tag));
+ tagw.WriteTo(writer);
+ tagw.reset();
+ }
+ catch (System.IO.IOException e)
+ {
+ assert(false);
+ }
+ }
+
+ private bool isLongHeader(Tag t)
+ {
+ switch (t.code)
+ {
+
+ // [preilly] In the player code, ScriptThread::DefineBits() assumes all DefineBits
+ // tags use a long header. See "ch->data = AttachData(pos-8);". If the player
+ // also supported a short header, it would use "pos-4".
+ case flash.swf.TagValues_Fields.stagDefineBits:
+ case flash.swf.TagValues_Fields.stagDefineBitsJPEG2:
+ case flash.swf.TagValues_Fields.stagDefineBitsJPEG3:
+ case flash.swf.TagValues_Fields.stagDefineBitsLossless:
+ case flash.swf.TagValues_Fields.stagDefineBitsLossless2:
+ return true;
+
+ // [ed] the FlashPaper codebase also indicates that stagSoundStreamBlock must use
+ // a long format header. todo - verify by looking at the player code.
+
+ case flash.swf.TagValues_Fields.stagSoundStreamBlock:
+ return true;
+
+ // [edsmith] these tags have code in them. When we're writing a SWD, we use long headers
+ // so we can predict SWF offsets correctly when writing SWD line/offset records.
+
+ case flash.swf.TagValues_Fields.stagDefineButton:
+ case flash.swf.TagValues_Fields.stagDefineButton2:
+ case flash.swf.TagValues_Fields.stagDefineSprite:
+ case flash.swf.TagValues_Fields.stagDoInitAction:
+ case flash.swf.TagValues_Fields.stagDoAction:
+ return Debug;
+
+
+ case flash.swf.TagValues_Fields.stagPlaceObject2:
+ return Debug && ((PlaceObject) t).hasClipAction();
+
+ // all other tags will use short/long headers depending on their length
+
+ default:
+ return false;
+
+ }
+ }
+
+ private void encodeTagHeader(int code, int length, bool longHeader)
+ {
+ if (longHeader || length >= 63)
+ {
+ writer.writeUI16((code << 6) | 63);
+ writer.write32(length);
+ }
+ else
+ {
+ writer.writeUI16((code << 6) | length);
+ }
+ }
+
+ public override void defineScalingGrid(DefineScalingGrid tag)
+ {
+ int idref = dict.getId(tag.scalingTarget);
+ tagw.writeUI16(idref);
+ encodeRect(tag.rect, tagw);
+ encodeTag(tag);
+ }
+
+ public override void defineBinaryData(DefineBinaryData tag)
+ {
+ encodeTagHeader(tag.code, 6 + tag.data.Length, false);
+ int id = dict.add(tag);
+ writer.writeUI16(id);
+ writer.write32(tag.reserved);
+ writer.write(tag.data);
+ }
+
+ public override void defineBits(DefineBits tag)
+ {
+ encodeTagHeader(tag.code, 2 + tag.data.Length, true);
+ int id = dict.add(tag);
+ writer.writeUI16(id);
+ writer.write(tag.data);
+ }
+
+ public override void defineBitsJPEG2(DefineBits tag)
+ {
+ defineBits(tag);
+ }
+
+ public override void defineBitsJPEG3(DefineBitsJPEG3 tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ tagw.write32(tag.data.Length);
+ tagw.write(tag.data);
+ tagw.markComp();
+ tagw.write(tag.alphaData);
+ encodeTag(tag);
+ }
+
+ public override void defineBitsLossless(DefineBitsLossless tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ tagw.writeUI8(tag.format);
+ tagw.writeUI16(tag.width);
+ tagw.writeUI16(tag.height);
+ switch (tag.format)
+ {
+
+ case 3:
+ tagw.writeUI8(tag.colorData.Length - 1);
+ tagw.markComp();
+ encodeColorMapData(tag.colorData, tag.data, tagw);
+ break;
+
+ case 4:
+ case 5:
+ tagw.markComp();
+ encodeBitmapData(tag.data, tagw);
+ break;
+ }
+ encodeTag(tag);
+ }
+
+ private void encodeBitmapData(sbyte[] data, SwfEncoder w)
+ {
+ w.write(data);
+ }
+
+ private void encodeColorMapData(int[] colorData, sbyte[] pixelData, SwfEncoder w)
+ {
+ for (int i = 0; i < colorData.Length; i++)
+ {
+ encodeRGB(colorData[i], w);
+ }
+ w.write(pixelData);
+ }
+
+ /// as 0x00RRGGBB
+ ///
+ ///
+ ///
+ private void encodeRGB(int rgb, SwfEncoder w)
+ {
+ w.writeUI8(SupportClass.URShift(rgb, 16)); // red. we don't mask this because if rgb has an Alpha value, something's wrong
+ w.writeUI8((SupportClass.URShift(rgb, 8)) & 255);
+ w.writeUI8(rgb & 255); // blue
+ }
+
+ public override void defineBitsLossless2(DefineBitsLossless tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ tagw.writeUI8(tag.format);
+ tagw.writeUI16(tag.width);
+ tagw.writeUI16(tag.height);
+ switch (tag.format)
+ {
+
+ case 3:
+ tagw.writeUI8(tag.colorData.Length - 1);
+ tagw.markComp();
+ encodeAlphaColorMapData(tag.colorData, tag.data, tagw);
+ break;
+
+ case 4:
+ case 5:
+ tagw.markComp();
+ encodeBitmapData(tag.data, tagw);
+ break;
+ }
+ encodeTag(tag);
+ }
+
+ private void encodeAlphaColorMapData(int[] colorData, sbyte[] pixelData, SwfEncoder w)
+ {
+ for (int i = 0; i < colorData.Length; i++)
+ {
+ encodeRGBA(colorData[i], w);
+ }
+ w.write(pixelData);
+ }
+
+ /// as 0xAARRGGBB
+ ///
+ ///
+ ///
+ private void encodeRGBA(int rgba, SwfEncoder w)
+ {
+ w.writeUI8((SupportClass.URShift(rgba, 16)) & 255); // red
+ w.writeUI8((SupportClass.URShift(rgba, 8)) & 255); // green
+ w.writeUI8(rgba & 255); // blue
+ w.writeUI8(SupportClass.URShift(rgba, 24)); // alpha
+ }
+
+ public override void defineButton(DefineButton tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+
+ if (Debug)
+ {
+ debug.adjust = writer.Pos + 6;
+ }
+
+ for (int i = 0; i < tag.buttonRecords.Length; i++)
+ {
+ encodeButtonRecord(tag.buttonRecords[i], tagw, tag.code);
+ }
+ tagw.writeUI8(0); // no more button records
+
+ // assume there is only one condition we will handle
+ new ActionEncoder(tagw, debug).encode(tag.condActions[0].actionList);
+ tagw.writeUI8(0); // write action end flag, must be zero
+ encodeTag(tag);
+
+ if (Debug)
+ {
+ debug.adjust = 0;
+ }
+ }
+
+ private void encodeButtonRecord(ButtonRecord record, SwfEncoder w, int defineButton)
+ {
+ if (defineButton == flash.swf.TagValues_Fields.stagDefineButton2)
+ {
+ w.writeUBits(0, 2);
+ w.writeBit(record.blendMode != - 1);
+ w.writeBit(record.filters != null);
+ }
+ else
+ {
+ w.writeUBits(0, 4);
+ }
+ w.writeBit(record.hitTest);
+ w.writeBit(record.down);
+ w.writeBit(record.over);
+ w.writeBit(record.up);
+
+ w.writeUI16(dict.getId(record.characterRef));
+ w.writeUI16(record.placeDepth);
+ encodeMatrix(record.placeMatrix, w);
+
+ if (defineButton == flash.swf.TagValues_Fields.stagDefineButton2)
+ {
+ encodeCxforma(record.colorTransform, w);
+ if (record.filters != null)
+ {
+ this.encodeFilterList(record.filters, w);
+ }
+ if (record.blendMode != - 1)
+ {
+ w.writeUI8(record.blendMode);
+ }
+ }
+ }
+
+ private void encodeCxforma(CXFormWithAlpha cxforma, SwfEncoder w)
+ {
+ w.writeBit(cxforma.hasAdd);
+ w.writeBit(cxforma.hasMult);
+
+ int nbits = cxforma.nbits();
+ w.writeUBits(nbits, 4);
+
+ if (cxforma.hasMult)
+ {
+ w.writeSBits(cxforma.redMultTerm, nbits);
+ w.writeSBits(cxforma.greenMultTerm, nbits);
+ w.writeSBits(cxforma.blueMultTerm, nbits);
+ w.writeSBits(cxforma.alphaMultTerm, nbits);
+ }
+
+ if (cxforma.hasAdd)
+ {
+ w.writeSBits(cxforma.redAddTerm, nbits);
+ w.writeSBits(cxforma.greenAddTerm, nbits);
+ w.writeSBits(cxforma.blueAddTerm, nbits);
+ w.writeSBits(cxforma.alphaAddTerm, nbits);
+ }
+
+ w.flushBits();
+ }
+
+ private void encodeMatrix(Matrix matrix, SwfEncoder w)
+ {
+ w.writeBit(matrix.hasScale);
+ if (matrix.hasScale)
+ {
+ int nScaleBits = matrix.nScaleBits();
+ w.writeUBits(nScaleBits, 5);
+ w.writeSBits(matrix.scaleX, nScaleBits);
+ w.writeSBits(matrix.scaleY, nScaleBits);
+ }
+
+ w.writeBit(matrix.hasRotate);
+ if (matrix.hasRotate)
+ {
+ int nRotateBits = matrix.nRotateBits();
+ w.writeUBits(nRotateBits, 5);
+ w.writeSBits(matrix.rotateSkew0, nRotateBits);
+ w.writeSBits(matrix.rotateSkew1, nRotateBits);
+ }
+
+ int nTranslateBits = matrix.nTranslateBits();
+ w.writeUBits(nTranslateBits, 5);
+ w.writeSBits(matrix.translateX, nTranslateBits);
+ w.writeSBits(matrix.translateY, nTranslateBits);
+
+ w.flushBits();
+ }
+
+ public override void defineButton2(DefineButton tag)
+ {
+ if (Debug)
+ {
+ debug.adjust = writer.Pos + 6;
+ }
+
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ tagw.writeUBits(0, 7); // reserved
+ tagw.writeBit(tag.trackAsMenu);
+ int offsetPos = tagw.Pos;
+ tagw.writeUI16(0); // actionOffset
+
+ for (int i = 0; i < tag.buttonRecords.Length; i++)
+ {
+ encodeButtonRecord(tag.buttonRecords[i], tagw, tag.code);
+ }
+
+ tagw.writeUI8(0); // charEndFlag
+
+ if (tag.condActions.Length > 0)
+ {
+ tagw.writeUI16at(offsetPos, tagw.Pos - offsetPos);
+
+ for (int i = 0; i < tag.condActions.Length; i++)
+ {
+ bool isLast = i + 1 == tag.condActions.Length;
+ encodeButtonCondAction(tag.condActions[i], tagw, isLast);
+ }
+ }
+ encodeTag(tag);
+
+ if (Debug)
+ {
+ debug.adjust = 0;
+ }
+ }
+
+ private void encodeButtonCondAction(ButtonCondAction condAction, SwfEncoder w, bool last)
+ {
+ int pos = w.Pos;
+ w.writeUI16(0);
+
+ w.writeUBits(condAction.keyPress, 7);
+ w.writeBit(condAction.overDownToIdle);
+
+ w.writeBit(condAction.idleToOverDown);
+ w.writeBit(condAction.outDownToIdle);
+ w.writeBit(condAction.outDownToOverDown);
+ w.writeBit(condAction.overDownToOutDown);
+ w.writeBit(condAction.overDownToOverUp);
+ w.writeBit(condAction.overUpToOverDown);
+ w.writeBit(condAction.overUpToIdle);
+ w.writeBit(condAction.idleToOverUp);
+
+ new ActionEncoder(w, debug).encode(condAction.actionList);
+ w.writeUI8(0); // end action byte
+
+ if (!last)
+ {
+ w.writeUI16at(pos, w.Pos - pos);
+ }
+ }
+
+ public override void defineButtonCxform(DefineButtonCxform tag)
+ {
+ int idref = dict.getId(tag.button);
+ tagw.writeUI16(idref);
+ encodeCxform(tag.colorTransform, tagw);
+ encodeTag(tag);
+ }
+
+ private void encodeCxform(CXForm cxform, SwfEncoder w)
+ {
+
+ w.writeBit(cxform.hasAdd);
+ w.writeBit(cxform.hasMult);
+
+ int nbits = cxform.nbits();
+ w.writeUBits(nbits, 4);
+
+ if (cxform.hasMult)
+ {
+ w.writeSBits(cxform.redMultTerm, nbits);
+ w.writeSBits(cxform.greenMultTerm, nbits);
+ w.writeSBits(cxform.blueMultTerm, nbits);
+ }
+
+ if (cxform.hasAdd)
+ {
+ w.writeSBits(cxform.redAddTerm, nbits);
+ w.writeSBits(cxform.greenAddTerm, nbits);
+ w.writeSBits(cxform.blueAddTerm, nbits);
+ }
+
+ w.flushBits();
+ }
+
+ public override void defineButtonSound(DefineButtonSound tag)
+ {
+ int idref = dict.getId(tag.button);
+ tagw.writeUI16(idref);
+ if (tag.sound0 != null)
+ {
+ tagw.writeUI16(dict.getId(tag.sound0));
+ encodeSoundInfo(tag.info0, tagw);
+ }
+ else
+ {
+ tagw.writeUI16(0);
+ }
+ if (tag.sound1 != null)
+ {
+ tagw.writeUI16(dict.getId(tag.sound1));
+ encodeSoundInfo(tag.info1, tagw);
+ }
+ else
+ {
+ tagw.writeUI16(0);
+ }
+ if (tag.sound2 != null)
+ {
+ tagw.writeUI16(dict.getId(tag.sound2));
+ encodeSoundInfo(tag.info2, tagw);
+ }
+ else
+ {
+ tagw.writeUI16(0);
+ }
+ if (tag.sound3 != null)
+ {
+ tagw.writeUI16(dict.getId(tag.sound3));
+ encodeSoundInfo(tag.info3, tagw);
+ }
+ else
+ {
+ tagw.writeUI16(0);
+ }
+ encodeTag(tag);
+ }
+
+ private void encodeSoundInfo(SoundInfo info, SwfEncoder w)
+ {
+ w.writeUBits(0, 2); // reserved
+ w.writeBit(info.syncStop);
+ w.writeBit(info.syncNoMultiple);
+ w.writeBit(info.records != null);
+ w.writeBit(info.loopCount != SoundInfo.UNINITIALIZED);
+ w.writeBit(info.outPoint != SoundInfo.UNINITIALIZED);
+ w.writeBit(info.inPoint != SoundInfo.UNINITIALIZED);
+
+ if (info.inPoint != SoundInfo.UNINITIALIZED)
+ {
+ w.write32((int) info.inPoint);
+ }
+ if (info.outPoint != SoundInfo.UNINITIALIZED)
+ {
+ w.write32((int) info.outPoint);
+ }
+ if (info.loopCount != SoundInfo.UNINITIALIZED)
+ {
+ w.writeUI16(info.loopCount);
+ }
+ if (info.records != null)
+ {
+ w.writeUI8(info.records.Length);
+ for (int k = 0; k < info.records.Length; k++)
+ {
+ w.write64(info.records[k]);
+ }
+ }
+ }
+
+ public override void defineEditText(DefineEditText tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ encodeRect(tag.bounds, tagw);
+
+ tagw.writeBit(tag.hasText);
+ tagw.writeBit(tag.wordWrap);
+ tagw.writeBit(tag.multiline);
+ tagw.writeBit(tag.password);
+ tagw.writeBit(tag.readOnly);
+ tagw.writeBit(tag.hasTextColor);
+ tagw.writeBit(tag.hasMaxLength);
+ tagw.writeBit(tag.hasFont);
+
+ tagw.writeBit(false); // reserved
+ tagw.writeBit(tag.autoSize);
+ tagw.writeBit(tag.hasLayout);
+ tagw.writeBit(tag.noSelect);
+ tagw.writeBit(tag.border);
+ tagw.writeBit(tag.wasStatic);
+ tagw.writeBit(tag.html);
+ tagw.writeBit(tag.useOutlines);
+
+ tagw.flushBits();
+
+ if (tag.hasFont)
+ {
+ int idref = dict.getId(tag.font);
+ tagw.writeUI16(idref);
+ tagw.writeUI16(tag.height);
+ }
+
+ if (tag.hasTextColor)
+ {
+ encodeRGBA(tag.color, tagw);
+ }
+
+ if (tag.hasMaxLength)
+ {
+ tagw.writeUI16(tag.maxLength);
+ }
+
+ if (tag.hasLayout)
+ {
+ tagw.writeUI8(tag.align);
+ tagw.writeUI16(tag.leftMargin);
+ tagw.writeUI16(tag.rightMargin);
+ tagw.writeUI16(tag.ident);
+ tagw.writeSI16(tag.leading); // see errata, leading is signed
+ }
+
+ tagw.writeString(tag.varName);
+ if (tag.hasText)
+ {
+ tagw.writeString(tag.initialText);
+ }
+ encodeTag(tag);
+ }
+
+ public override void defineFont(DefineFont1 tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+
+ int count = tag.glyphShapeTable.Length;
+
+ int offsetPos = tagw.Pos;
+
+ // write offset placeholders
+ for (int i = 0; i < count; i++)
+ {
+ tagw.writeUI16(0);
+ }
+
+ // now write glyphs and update the encoded offset table
+ for (int i = 0; i < count; i++)
+ {
+ tagw.writeUI16at(offsetPos + 2 * i, tagw.Pos - offsetPos);
+ encodeShape(tag.glyphShapeTable[i], tagw, flash.swf.TagValues_Fields.stagDefineShape3, 1, 0);
+ }
+
+ encodeTag(tag);
+ }
+
+ public virtual void encodeShape(Shape s, SwfEncoder w, int shape, int nFillStyles, int nLineStyles)
+ {
+ int[] numFillBits = new int[]{SwfEncoder.minBits(nFillStyles, 0)};
+ int[] numLineBits = new int[]{SwfEncoder.minBits(nLineStyles, 0)};
+
+ w.writeUBits(numFillBits[0], 4);
+ w.writeUBits(numLineBits[0], 4);
+
+ System.Collections.IEnumerator it = s.shapeRecords.GetEnumerator();
+ //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
+ while (it.MoveNext())
+ {
+ //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
+ ShapeRecord record = (ShapeRecord) it.Current;
+ if (record is StyleChangeRecord)
+ {
+ // style change
+ w.writeBit(false);
+ StyleChangeRecord change = (StyleChangeRecord) record;
+ encodeStyleChangeRecord(w, change, numFillBits, numLineBits, shape);
+ }
+ else
+ {
+ // edge
+ w.writeBit(true);
+ EdgeRecord e = (EdgeRecord) record;
+ bool straight = e is StraightEdgeRecord;
+ w.writeBit(straight);
+ int nbits = straight?calcBits((StraightEdgeRecord) e):calcBits((CurvedEdgeRecord) e);
+ if (nbits < 2)
+ nbits = 2;
+ w.writeUBits(nbits - 2, 4);
+ if (straight)
+ {
+ // line
+ StraightEdgeRecord line = (StraightEdgeRecord) e;
+ encodeStraightEdgeRecord(line, w, nbits);
+ }
+ else
+ {
+ // curve
+ CurvedEdgeRecord curve = (CurvedEdgeRecord) e;
+ w.writeSBits(curve.controlDeltaX, nbits);
+ w.writeSBits(curve.controlDeltaY, nbits);
+ w.writeSBits(curve.anchorDeltaX, nbits);
+ w.writeSBits(curve.anchorDeltaY, nbits);
+ }
+ }
+ }
+
+ // endshaperecord
+ w.writeUBits(0, 6);
+
+ w.flushBits();
+ }
+
+ private int calcBits(StraightEdgeRecord edge)
+ {
+ return SwfEncoder.minBits(SwfEncoder.maxNum(edge.deltaX, edge.deltaY, 0, 0), 1);
+ }
+
+ private int calcBits(CurvedEdgeRecord edge)
+ {
+ return SwfEncoder.minBits(SwfEncoder.maxNum(edge.controlDeltaX, edge.controlDeltaY, edge.anchorDeltaX, edge.anchorDeltaY), 1);
+ }
+
+ private void encodeStraightEdgeRecord(StraightEdgeRecord line, SwfEncoder w, int nbits)
+ {
+ if (line.deltaX == 0)
+ {
+ w.writeUBits(1, 2); // vertical line
+ w.writeSBits(line.deltaY, nbits);
+ }
+ else if (line.deltaY == 0)
+ {
+ w.writeUBits(0, 2); // horizontal line
+ w.writeSBits(line.deltaX, nbits);
+ }
+ else
+ {
+ w.writeBit(true); // general line
+ w.writeSBits(line.deltaX, nbits);
+ w.writeSBits(line.deltaY, nbits);
+ }
+ }
+
+ private void encodeStyleChangeRecord(SwfEncoder w, StyleChangeRecord s, int[] numFillBits, int[] numLineBits, int shape)
+ {
+ w.writeBit(s.stateNewStyles);
+ w.writeBit(s.stateLineStyle);
+ w.writeBit(s.stateFillStyle1);
+ w.writeBit(s.stateFillStyle0);
+ w.writeBit(s.stateMoveTo);
+
+ if (s.stateMoveTo)
+ {
+ int moveBits = s.nMoveBits();
+ w.writeUBits(moveBits, 5);
+ w.writeSBits(s.moveDeltaX, moveBits);
+ w.writeSBits(s.moveDeltaY, moveBits);
+ }
+
+ if (s.stateFillStyle0)
+ {
+ w.writeUBits(s.fillstyle0, numFillBits[0]);
+ }
+
+ if (s.stateFillStyle1)
+ {
+ w.writeUBits(s.fillstyle1, numFillBits[0]);
+ }
+
+ if (s.stateLineStyle)
+ {
+ w.writeUBits(s.linestyle, numLineBits[0]);
+ }
+
+ if (s.stateNewStyles)
+ {
+ w.flushBits();
+
+ encodeFillstyles(s.fillstyles, w, shape);
+ encodeLinestyles(s.linestyles, w, shape);
+
+ numFillBits[0] = SwfEncoder.minBits(s.fillstyles.Count, 0);
+ numLineBits[0] = SwfEncoder.minBits(s.linestyles.Count, 0);
+ w.writeUBits(numFillBits[0], 4);
+ w.writeUBits(numLineBits[0], 4);
+ }
+ }
+
+ private void encodeLinestyles(System.Collections.ArrayList linestyles, SwfEncoder w, int shape)
+ {
+ int count = linestyles.Count;
+ if (count > 0xFF)
+ {
+ w.writeUI8(0xFF);
+ w.writeUI16(count);
+ }
+ else
+ {
+ w.writeUI8(count);
+ }
+
+ for (int i = 0; i < count; i++)
+ {
+ encodeLineStyle((LineStyle) linestyles[i], w, shape);
+ }
+ }
+
+ private void encodeLineStyle(LineStyle lineStyle, SwfEncoder w, int shape)
+ {
+ w.writeUI16(lineStyle.width);
+
+ if (shape == flash.swf.TagValues_Fields.stagDefineShape6)
+ {
+ w.writeUI16(lineStyle.flags);
+ if (lineStyle.hasMiterJoint())
+ w.writeUI16(lineStyle.miterLimit);
+ }
+
+ if (shape == flash.swf.TagValues_Fields.stagDefineShape6 && lineStyle.hasFillStyle())
+ {
+ encodeFillStyle(lineStyle.fillStyle, w, shape);
+ }
+ else if ((shape == flash.swf.TagValues_Fields.stagDefineShape3) || (shape == flash.swf.TagValues_Fields.stagDefineShape6))
+ {
+ encodeRGBA(lineStyle.color, w);
+ }
+ else
+ {
+ encodeRGB(lineStyle.color, w);
+ }
+ }
+
+ private void encodeFillstyles(System.Collections.ArrayList fillstyles, SwfEncoder w, int shape)
+ {
+ int count = fillstyles.Count;
+ if (count >= 0xFF)
+ {
+ w.writeUI8(0xFF);
+ w.writeUI16(count);
+ }
+ else
+ {
+ w.writeUI8(count);
+ }
+
+ System.Collections.IEnumerator it = fillstyles.GetEnumerator();
+ //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
+ while (it.MoveNext())
+ {
+ //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
+ FillStyle style = (FillStyle) it.Current;
+ encodeFillStyle(style, w, shape);
+ }
+ }
+
+ private void encodeFillStyle(FillStyle style, SwfEncoder w, int shape)
+ {
+ w.writeUI8(style.type);
+ switch (style.type)
+ {
+
+ case FillStyle.FILL_SOLID: // 0x00
+ if ((shape == flash.swf.TagValues_Fields.stagDefineShape3) || (shape == flash.swf.TagValues_Fields.stagDefineShape6))
+ encodeRGBA(style.color, w);
+ else
+ encodeRGB(style.color, w);
+ break;
+
+ case FillStyle.FILL_GRADIENT:
+ // 0x10 linear gradient fill
+ case FillStyle.FILL_RADIAL_GRADIENT:
+ // 0x12 radial gradient fill
+ case FillStyle.FILL_FOCAL_RADIAL_GRADIENT: // 0x13 focal radial gradient fill
+ encodeMatrix(style.matrix, w);
+ encodeGradient(style.gradient, w, shape);
+ break;
+
+ case FillStyle.FILL_BITS:
+ // 0x40 tiled bitmap fill
+ case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_CLIP):
+ // 0x41 clipped bitmap fill
+ case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_NOSMOOTH):
+ // 0x42 tiled non-smoothed fill
+ case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_CLIP | FillStyle.FILL_BITS_NOSMOOTH): // 0x43 clipped non-smoothed fill
+ w.writeUI16(dict.getId(style.bitmap));
+ encodeMatrix(style.matrix, w);
+ break;
+ }
+ }
+
+ private void encodeGradient(Gradient gradient, SwfEncoder w, int shape)
+ {
+ w.writeUBits(gradient.spreadMode, 2);
+ w.writeUBits(gradient.interpolationMode, 2);
+ w.writeUBits(gradient.records.Length, 4);
+ for (int i = 0; i < gradient.records.Length; i++)
+ {
+ encodeGradRecord(gradient.records[i], w, shape);
+ }
+ if (gradient is FocalGradient)
+ {
+ w.writeFixed8(((FocalGradient) gradient).focalPoint);
+ }
+ }
+
+ private void encodeGradRecord(GradRecord record, SwfEncoder w, int shape)
+ {
+ w.writeUI8(record.ratio);
+ if ((shape == flash.swf.TagValues_Fields.stagDefineShape3) || (shape == flash.swf.TagValues_Fields.stagDefineShape6))
+ encodeRGBA(record.color, w);
+ else
+ encodeRGB(record.color, w);
+ }
+
+ public override void defineFont2(DefineFont2 tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ int startPos = tagw.Pos;
+ bool again;
+
+ if (tag.code == flash.swf.TagValues_Fields.stagDefineFont3)
+ {
+ tag.wideCodes = true;
+ }
+
+ if (!tag.wideCodes)
+ {
+ for (int i = 0; i < tag.codeTable.Length; i++)
+ {
+ if (tag.codeTable[i] > 255)
+ {
+ tag.wideCodes = true;
+ break;
+ }
+ }
+ }
+
+ //UPGRADE_NOTE: Label 'loop' was moved. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1014'"
+ do
+ {
+ again = false;
+ tagw.writeBit(tag.hasLayout);
+ tagw.writeBit(tag.shiftJIS);
+ tagw.writeBit(tag.smallText);
+ tagw.writeBit(tag.ansi);
+ tagw.writeBit(tag.wideOffsets);
+ tagw.writeBit(tag.wideCodes);
+ tagw.writeBit(tag.italic);
+ tagw.writeBit(tag.bold);
+ tagw.flushBits();
+
+ tagw.writeUI8(tag.langCode);
+
+ tagw.writeLengthString(tag.fontName);
+ int count = tag.glyphShapeTable.Length;
+
+ tagw.writeUI16(count);
+ int offsetPos = tagw.Pos;
+
+ // save space for the offset table
+ if (tag.wideOffsets)
+ {
+ for (int i = 0; i < count; i++)
+ {
+ tagw.write32(0);
+ }
+ }
+ else
+ {
+ for (int i = 0; i < count; i++)
+ {
+ tagw.writeUI16(0);
+ }
+ }
+
+ //PJF: write placeholder for codeTableOffset, this will be changed after shapes encoded
+ if (count > 0)
+ {
+ if (tag.wideOffsets)
+ {
+ tagw.write32(0);
+ }
+ else
+ {
+ tagw.writeUI16(0);
+ }
+ }
+
+ for (int i = 0; i < count; i++)
+ {
+ // save offset to this glyph
+ int offset = tagw.Pos - offsetPos;
+ if (!tag.wideOffsets && offset > 65535)
+ {
+ again = true;
+ tag.wideOffsets = true;
+ tagw.Pos = startPos;
+ //UPGRADE_NOTE: Labeled continue statement was changed to a goto statement. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1015'"
+ goto loop;
+ }
+ if (tag.wideOffsets)
+ tagw.write32at(offsetPos + 4 * i, offset);
+ else
+ tagw.writeUI16at(offsetPos + 2 * i, offset);
+
+ encodeShape(tag.glyphShapeTable[i], tagw, flash.swf.TagValues_Fields.stagDefineShape3, 1, 0);
+ }
+
+ // update codeTableOffset
+ int offset2 = tagw.Pos - offsetPos;
+ if (!tag.wideOffsets && offset2 > 65535)
+ {
+ again = true;
+ tag.wideOffsets = true;
+ tagw.Pos = startPos;
+ //UPGRADE_NOTE: Labeled continue statement was changed to a goto statement. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1015'"
+ goto loop;
+ }
+ if (tag.wideOffsets)
+ {
+ tagw.write32at(offsetPos + 4 * count, offset2);
+ }
+ else
+ {
+ tagw.writeUI16at(offsetPos + 2 * count, offset2);
+ }
+
+ // now write the codetable
+
+ if (tag.wideCodes)
+ {
+ for (int i = 0; i < tag.codeTable.Length; i++)
+ {
+ tagw.writeUI16(tag.codeTable[i]);
+ }
+ }
+ else
+ {
+ for (int i = 0; i < tag.codeTable.Length; i++)
+ {
+ tagw.writeUI8(tag.codeTable[i]);
+ }
+ }
+
+ if (tag.hasLayout)
+ {
+ tagw.writeSI16(tag.ascent);
+ tagw.writeSI16(tag.descent);
+ tagw.writeSI16(tag.leading);
+
+ for (int i = 0; i < tag.advanceTable.Length; i++)
+ {
+ tagw.writeSI16(tag.advanceTable[i]);
+ }
+
+ for (int i = 0; i < tag.boundsTable.Length; i++)
+ {
+ encodeRect(tag.boundsTable[i], tagw);
+ }
+
+ tagw.writeUI16(tag.kerningTable.Length);
+
+ for (int i = 0; i < tag.kerningTable.Length; i++)
+ {
+ if (!tag.wideCodes && ((tag.kerningTable[i].code1 > 255) || (tag.kerningTable[i].code2 > 255)))
+ {
+ again = true;
+ tag.wideCodes = true;
+ tagw.Pos = startPos;
+ //UPGRADE_NOTE: Labeled continue statement was changed to a goto statement. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1015'"
+ goto loop;
+ }
+
+ encodeKerningRecord(tag.kerningTable[i], tagw, tag.wideCodes);
+ }
+ }
+ //UPGRADE_NOTE: Label 'loop' was moved. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1014'"
+loop: ;
+ }
+ while (again);
+
+ encodeTag(tag);
+ }
+
+ public override void defineFont3(DefineFont3 tag)
+ {
+ defineFont2(tag);
+ }
+
+ public override void defineFont4(DefineFont4 tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+
+ tagw.writeUBits(0, 5); // reserved
+ tagw.writeBit(tag.hasFontData);
+ //tagw.writeBit(tag.smallText);
+ tagw.writeBit(tag.italic);
+ tagw.writeBit(tag.bold);
+ tagw.flushBits();
+
+ //tagw.writeUI8(tag.langCode);
+ tagw.writeString(tag.fontName);
+ if (tag.hasFontData)
+ {
+ tagw.write(tag.data);
+ }
+
+ encodeTag(tag);
+ }
+
+ public override void defineFontAlignZones(DefineFontAlignZones tag)
+ {
+ int fontID = dict.getId(tag.font);
+ tagw.writeUI16(fontID);
+ tagw.writeUBits(tag.csmTableHint, 2);
+ tagw.writeUBits(0, 6); // reserved
+ for (int i = 0; i < tag.zoneTable.Length; i++)
+ {
+ ZoneRecord record = tag.zoneTable[i];
+ tagw.writeUI8(record.numZoneData);
+ for (int j = 0; j < record.numZoneData; j++)
+ {
+ tagw.write32((int) record.zoneData[j]);
+ }
+ tagw.writeUI8(record.zoneMask);
+ }
+ encodeTag(tag);
+ }
+
+ public override void csmTextSettings(CSMTextSettings tag)
+ {
+ int textID = 0;
+ if (tag.textReference != null)
+ {
+ textID = dict.getId(tag.textReference);
+ }
+ tagw.writeUI16(textID);
+ tagw.writeUBits(tag.styleFlagsUseSaffron, 2);
+ tagw.writeUBits(tag.gridFitType, 3);
+ tagw.writeUBits(0, 3); // reserved
+ // FIXME: thickness/sharpness should be written out as 32 bit IEEE Single Precision format in little Endian
+ tagw.writeUBits((int) tag.thickness, 32);
+ tagw.writeUBits((int) tag.sharpness, 32);
+ tagw.writeUBits(0, 8); //reserved
+
+ encodeTag(tag);
+ }
+
+ public override void defineFontName(DefineFontName tag)
+ {
+ int fontID = dict.getId(tag.font);
+ tagw.writeUI16(fontID);
+ if (tag.fontName != null)
+ {
+ tagw.writeString(tag.fontName);
+ }
+ else
+ {
+ tagw.writeString("");
+ }
+ if (tag.copyright != null)
+ {
+ tagw.writeString(tag.copyright);
+ }
+ else
+ {
+ tagw.writeString("");
+ }
+
+ encodeTag(tag);
+ }
+
+ private void encodeKerningRecord(KerningRecord kerningRecord, SwfEncoder w, bool wideCodes)
+ {
+ if (wideCodes)
+ {
+ w.writeUI16(kerningRecord.code1);
+ w.writeUI16(kerningRecord.code2);
+ }
+ else
+ {
+ w.writeUI8(kerningRecord.code1);
+ w.writeUI8(kerningRecord.code2);
+ }
+ w.writeUI16(kerningRecord.adjustment);
+ }
+
+ public override void defineFontInfo(DefineFontInfo tag)
+ {
+ int idref = dict.getId(tag.font);
+ tagw.writeUI16(idref);
+
+ tagw.writeLengthString(tag.name);
+
+ tagw.writeUBits(0, 3); // reserved
+ tagw.writeBit(tag.shiftJIS);
+ tagw.writeBit(tag.ansi);
+ tagw.writeBit(tag.italic);
+ tagw.writeBit(tag.bold);
+
+ if (tag.code == flash.swf.TagValues_Fields.stagDefineFontInfo2)
+ {
+ tagw.writeBit(tag.wideCodes = true);
+ tagw.writeUI8(tag.langCode);
+ }
+ else
+ {
+ if (!tag.wideCodes)
+ {
+ for (int i = 0; i < tag.codeTable.Length; i++)
+ {
+ if (tag.codeTable[i] > 255)
+ {
+ tag.wideCodes = true;
+ break;
+ }
+ }
+ }
+ tagw.writeBit(tag.wideCodes);
+ }
+
+ if (tag.wideCodes)
+ {
+ for (int i = 0; i < tag.codeTable.Length; i++)
+ tagw.writeUI16(tag.codeTable[i]);
+ }
+ else
+ {
+ for (int i = 0; i < tag.codeTable.Length; i++)
+ tagw.writeUI8(tag.codeTable[i]);
+ }
+ encodeTag(tag);
+ }
+
+ public override void defineFontInfo2(DefineFontInfo tag)
+ {
+ defineFontInfo(tag);
+ }
+
+ public override void defineMorphShape(DefineMorphShape tag)
+ {
+ defineMorphShape2(tag);
+ }
+
+ public override void defineMorphShape2(DefineMorphShape tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ encodeRect(tag.startBounds, tagw);
+ encodeRect(tag.endBounds, tagw);
+ if (tag.code == flash.swf.TagValues_Fields.stagDefineMorphShape2)
+ {
+ encodeRect(tag.startEdgeBounds, tagw);
+ encodeRect(tag.endEdgeBounds, tagw);
+ tagw.writeUBits(tag.reserved, 6);
+ tagw.writeUBits(tag.usesNonScalingStrokes?1:0, 1);
+ tagw.writeUBits(tag.usesScalingStrokes?1:0, 1);
+ }
+ tagw.write32(0);
+ int pos = tagw.Pos;
+ encodeMorphFillstyles(tag.fillStyles, tagw, tag.code);
+ encodeMorphLinestyles(tag.lineStyles, tagw, tag.code);
+ encodeShape(tag.startEdges, tagw, flash.swf.TagValues_Fields.stagDefineShape3, tag.fillStyles.Length, tag.lineStyles.Length);
+ tagw.write32at(pos - 4, tagw.Pos - pos);
+ // end shape contains only edges, no style information
+ encodeShape(tag.endEdges, tagw, flash.swf.TagValues_Fields.stagDefineShape3, 0, 0);
+ encodeTag(tag);
+ }
+
+ private void encodeMorphFillstyles(MorphFillStyle[] fillStyles, SwfEncoder w, int code)
+ {
+ int count = fillStyles.Length;
+ if (count >= 0xFF)
+ {
+ w.writeUI8(0xFF);
+ w.writeUI16(count);
+ }
+ else
+ {
+ w.writeUI8(count);
+ }
+
+ for (int i = 0; i < count; i++)
+ {
+ encodeMorphFillstyle(fillStyles[i], w, code);
+ }
+ }
+
+ private void encodeMorphFillstyle(MorphFillStyle style, SwfEncoder w, int code)
+ {
+ w.writeUI8(style.type);
+ switch (style.type)
+ {
+
+ case FillStyle.FILL_SOLID: // 0x00
+ encodeRGBA(style.startColor, w);
+ encodeRGBA(style.endColor, w);
+ break;
+
+ case FillStyle.FILL_GRADIENT:
+ // 0x10 linear gradient fill
+ case FillStyle.FILL_RADIAL_GRADIENT:
+ // 0x12 radial gradient fill
+ case FillStyle.FILL_FOCAL_RADIAL_GRADIENT: // 0x13 focal radial gradient fill
+ encodeMatrix(style.startGradientMatrix, w);
+ encodeMatrix(style.endGradientMatrix, w);
+ encodeMorphGradient(style.gradRecords, w);
+ if (style.type == FillStyle.FILL_FOCAL_RADIAL_GRADIENT && code == flash.swf.TagValues_Fields.stagDefineMorphShape2)
+ {
+ w.writeSI16(style.ratio1);
+ w.writeSI16(style.ratio2);
+ }
+ break;
+
+ case FillStyle.FILL_BITS:
+ // 0x40 tiled bitmap fill
+ case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_CLIP):
+ // 0x41 clipped bitmap fill
+ case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_NOSMOOTH):
+ // 0x42 tiled non-smoothed fill
+ case (FillStyle.FILL_BITS | FillStyle.FILL_BITS_CLIP | FillStyle.FILL_BITS_NOSMOOTH): // 0x43 clipped non-smoothed fill
+ w.writeUI16(dict.getId(style.bitmap));
+ encodeMatrix(style.startBitmapMatrix, w);
+ encodeMatrix(style.endBitmapMatrix, w);
+ break;
+
+ default:
+ assert(false);
+ //throw new IOException("unrecognized fill style type: " + style.type);
+ break;
+
+ }
+ }
+
+ private void encodeMorphGradient(MorphGradRecord[] gradRecords, SwfEncoder w)
+ {
+ w.writeUI8(gradRecords.Length);
+ for (int i = 0; i < gradRecords.Length; i++)
+ {
+ MorphGradRecord record = gradRecords[i];
+ w.writeUI8(record.startRatio);
+ encodeRGBA(record.startColor, w);
+ w.writeUI8(record.endRatio);
+ encodeRGBA(record.endColor, w);
+ }
+ }
+
+ private void encodeMorphLinestyles(MorphLineStyle[] lineStyles, SwfEncoder w, int code)
+ {
+ if (lineStyles.Length >= 0xFF)
+ {
+ w.writeUI8(0xFF);
+ w.writeUI16(lineStyles.Length);
+ }
+ else
+ {
+ w.writeUI8(lineStyles.Length);
+ }
+
+ for (int i = 0; i < lineStyles.Length; i++)
+ {
+ MorphLineStyle style = lineStyles[i];
+ w.writeUI16(style.startWidth);
+ w.writeUI16(style.endWidth);
+ if (code == flash.swf.TagValues_Fields.stagDefineMorphShape2)
+ {
+ w.writeUBits(style.startCapsStyle, 2);
+ w.writeUBits(style.jointStyle, 2);
+ w.writeBit(style.hasFill);
+ w.writeBit(style.noHScale);
+ w.writeBit(style.noVScale);
+ w.writeBit(style.pixelHinting);
+ w.writeUBits(0, 5); // reserved
+ w.writeBit(style.noClose);
+ w.writeUBits(style.endCapsStyle, 2);
+ if (style.jointStyle == 2)
+ {
+ w.writeUI16(style.miterLimit);
+ }
+ }
+ if (!style.hasFill)
+ {
+ encodeRGBA(style.startColor, w);
+ encodeRGBA(style.endColor, w);
+ }
+ if (style.hasFill)
+ {
+ encodeMorphFillstyle(style.fillType, w, code);
+ }
+ }
+ }
+
+ public override void defineShape(DefineShape tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ encodeRect(tag.bounds, tagw);
+ if (tag.code == flash.swf.TagValues_Fields.stagDefineShape6)
+ {
+ encodeRect(tag.edgeBounds, tagw);
+ tagw.writeUBits(0, 6);
+ tagw.writeBit(tag.usesNonScalingStrokes);
+ tagw.writeBit(tag.usesScalingStrokes);
+ }
+ encodeShapeWithStyle(tag.shapeWithStyle, tagw, tag.code);
+ encodeTag(tag);
+ }
+
+ private void encodeShapeWithStyle(ShapeWithStyle shapeWithStyle, SwfEncoder w, int shape)
+ {
+ encodeFillstyles(shapeWithStyle.fillstyles, w, shape);
+ encodeLinestyles(shapeWithStyle.linestyles, w, shape);
+
+ encodeShape(shapeWithStyle, w, shape, shapeWithStyle.fillstyles.Count, shapeWithStyle.linestyles.Count);
+ }
+
+ public override void defineShape2(DefineShape tag)
+ {
+ defineShape(tag);
+ }
+
+ public override void defineShape3(DefineShape tag)
+ {
+ defineShape(tag);
+ }
+
+ public override void defineShape6(DefineShape tag)
+ {
+ defineShape(tag);
+ }
+
+ public override void defineSound(DefineSound tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ tagw.writeUBits(tag.format, 4);
+ tagw.writeUBits(tag.rate, 2);
+ tagw.writeUBits(tag.size, 1);
+ tagw.writeUBits(tag.type, 1);
+ tagw.write32((int) tag.sampleCount);
+ tagw.write(tag.data);
+ encodeTag(tag);
+ }
+
+ public override void defineSprite(DefineSprite tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ tagw.writeUI16(tag.framecount);
+
+ if (Debug)
+ {
+ debug.adjust = writer.Pos + 6;
+ }
+
+ // save frame count
+ int oldFrames = frames;
+ frames = 0;
+
+ // save the movie writer, and push a new writer
+ SwfEncoder oldWriter = writer;
+ writer = tagw;
+ tagw = createEncoder(SwfVersion);
+
+ // write sprite tags
+ System.Collections.IList tags = tag.tagList.tags;
+ int size = tags.Count;
+ for (int i = 0; i < size; i++)
+ {
+ Tag t = (Tag) tags[i];
+ if (!(t is DefineTag))
+ t.visit(this);
+ }
+
+ // terminate with end marker
+ writer.writeUI16(0);
+
+ // update frame count
+ writer.writeUI16at(2, frames);
+
+ // restore writers
+ tagw = writer;
+ writer = oldWriter;
+ frames = oldFrames;
+
+ if (Debug)
+ {
+ debug.adjust = 0;
+ }
+
+ encodeTag(tag);
+ }
+
+ public override void defineText(DefineText tag)
+ {
+ encodeDefineText(tag, tagw, tag.code);
+ encodeTag(tag);
+ }
+
+ private void encodeDefineText(DefineText tag, SwfEncoder w, int type)
+ {
+ int id = dict.add(tag);
+ w.writeUI16(id);
+ encodeRect(tag.bounds, w);
+ encodeMatrix(tag.matrix, w);
+ int length = tag.records.Count;
+
+ // compute necessary bit width
+ int glyphBits = 0;
+ int advanceBits = 0;
+ for (int i = 0; i < length; i++)
+ {
+ TextRecord tr = (TextRecord) tag.records[i];
+
+ for (int j = 0; j < tr.entries.Length; j++)
+ {
+ GlyphEntry entry = tr.entries[j];
+
+ while (entry.Index > (1 << glyphBits))
+ glyphBits++;
+ while (System.Math.Abs(entry.advance) > (1 << advanceBits))
+ advanceBits++;
+ }
+ }
+
+ // increment to get from bit index to bit count.
+ ++glyphBits;
+ ++advanceBits;
+
+ w.writeUI8(glyphBits);
+ w.writeUI8(++advanceBits); // add one extra bit because advances are signed
+
+ for (int i = 0; i < length; i++)
+ {
+ TextRecord record = (TextRecord) tag.records[i];
+ encodeTextRecord(record, w, type, glyphBits, advanceBits);
+ }
+
+ w.writeUI8(0);
+ }
+
+ private void encodeFilterList(System.Collections.IList filters, SwfEncoder w)
+ {
+ int count = filters.Count;
+ w.writeUI8(count);
+ //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
+ for (System.Collections.IEnumerator it = filters.GetEnumerator(); it.MoveNext(); )
+ {
+ //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
+ Filter f = (Filter) it.Current;
+ w.writeUI8(f.getID());
+ // I've never quite understood why the serialization code isn't in the tags themselves..
+ switch (f.getID())
+ {
+
+ case DropShadowFilter.ID: encodeDropShadowFilter(w, (DropShadowFilter) f); break;
+
+ case BlurFilter.ID: encodeBlurFilter(w, (BlurFilter) f); break;
+
+ case ConvolutionFilter.ID: encodeConvolutionFilter(w, (ConvolutionFilter) f); break;
+
+ case GlowFilter.ID: encodeGlowFilter(w, (GlowFilter) f); break;
+
+ case BevelFilter.ID: encodeBevelFilter(w, (BevelFilter) f); break;
+
+ case ColorMatrixFilter.ID: encodeColorMatrixFilter(w, (ColorMatrixFilter) f); break;
+
+ case GradientGlowFilter.ID: encodeGradientGlowFilter(w, (GradientGlowFilter) f); break;
+
+ case GradientBevelFilter.ID: encodeGradientBevelFilter(w, (GradientBevelFilter) f); break;
+ }
+ }
+ }
+
+ private void encodeDropShadowFilter(SwfEncoder w, DropShadowFilter f)
+ {
+ encodeRGBA(f.color, w);
+ w.write32(f.blurX);
+ w.write32(f.blurY);
+ w.write32(f.angle);
+ w.write32(f.distance);
+ w.writeUI16(f.strength);
+ w.writeUI8(f.flags);
+ }
+
+ private void encodeBlurFilter(SwfEncoder w, BlurFilter f)
+ {
+ w.write32(f.blurX);
+ w.write32(f.blurY);
+ w.writeUI8(f.passes);
+ }
+ private void encodeColorMatrixFilter(SwfEncoder w, ColorMatrixFilter f)
+ {
+ for (int i = 0; i < 20; ++i)
+ {
+ w.writeFloat(f.values[i]);
+ }
+ }
+ private void encodeConvolutionFilter(SwfEncoder w, ConvolutionFilter f)
+ {
+ w.writeUI8(f.matrixX);
+ w.writeUI8(f.matrixY);
+ w.writeFloat(f.divisor);
+ w.writeFloat(f.bias);
+ for (int i = 0; i < f.matrix.Length; ++i)
+ w.writeFloat(f.matrix[i]);
+ w.writeUI8(f.flags);
+ }
+ private void encodeGlowFilter(SwfEncoder w, GlowFilter f)
+ {
+ encodeRGBA(f.color, w);
+ w.write32(f.blurX);
+ w.write32(f.blurY);
+ w.writeUI16(f.strength);
+ w.writeUI8(f.flags);
+ }
+ private void encodeBevelFilter(SwfEncoder w, BevelFilter f)
+ {
+ encodeRGBA(f.shadowColor, w);
+ encodeRGBA(f.highlightColor, w);
+ w.write32(f.blurX);
+ w.write32(f.blurY);
+ w.write32(f.angle);
+ w.write32(f.distance);
+ w.writeUI16(f.strength);
+ w.writeUI8(f.flags);
+ }
+
+ private void encodeGradientGlowFilter(SwfEncoder w, GradientGlowFilter f)
+ {
+ w.writeUI8(f.numcolors);
+ for (int i = 0; i < f.numcolors; ++i)
+ encodeRGBA(f.gradientColors[i], w);
+ for (int i = 0; i < f.numcolors; ++i)
+ w.writeUI8(f.gradientRatio[i]);
+ //w.write32( f.color );
+ w.write32(f.blurX);
+ w.write32(f.blurY);
+ w.write32(f.angle);
+ w.write32(f.distance);
+ w.writeUI16(f.strength);
+ w.writeUI8(f.flags);
+ }
+ private void encodeGradientBevelFilter(SwfEncoder w, GradientBevelFilter f)
+ {
+ w.writeUI8(f.numcolors);
+ for (int i = 0; i < f.numcolors; ++i)
+ encodeRGBA(f.gradientColors[i], w);
+ for (int i = 0; i < f.numcolors; ++i)
+ w.writeUI8(f.gradientRatio[i]);
+
+ // w.write32( f.shadowColor );
+ // w.write32( f.highlightColor );
+ w.write32(f.blurX);
+ w.write32(f.blurY);
+ w.write32(f.angle);
+ w.write32(f.distance);
+ w.writeUI16(f.strength);
+ w.writeUI8(f.flags);
+ }
+
+ private void encodeTextRecord(TextRecord record, SwfEncoder w, int type, int glyphBits, int advanceBits)
+ {
+ w.writeUI8(record.flags);
+
+ if (record.hasFont())
+ {
+ w.writeUI16(dict.getId(record.font));
+ }
+
+ if (record.hasColor())
+ {
+ if (type == flash.swf.TagValues_Fields.stagDefineText2)
+ encodeRGBA(record.color, w);
+ else
+ encodeRGB(record.color, w);
+ }
+
+ if (record.hasX())
+ {
+ w.writeSI16(record.xOffset);
+ }
+
+ if (record.hasY())
+ {
+ w.writeSI16(record.yOffset);
+ }
+
+ if (record.hasHeight())
+ {
+ w.writeUI16(record.height);
+ }
+
+ w.writeUI8(record.entries.Length);
+
+ for (int i = 0; i < record.entries.Length; i++)
+ {
+ w.writeUBits(record.entries[i].Index, glyphBits);
+ w.writeSBits(record.entries[i].advance, advanceBits);
+ }
+ w.flushBits();
+ }
+
+ public override void defineText2(DefineText tag)
+ {
+ defineText(tag);
+ }
+
+ public override void defineVideoStream(DefineVideoStream tag)
+ {
+ int id = dict.add(tag);
+ tagw.writeUI16(id);
+ tagw.writeUI16(tag.numFrames);
+ tagw.writeUI16(tag.width);
+ tagw.writeUI16(tag.height);
+
+ tagw.writeUBits(0, 4); // reserved
+ tagw.writeUBits(tag.deblocking, 3);
+ tagw.writeBit(tag.smoothing);
+
+ tagw.writeUI8(tag.codecID);
+ encodeTag(tag);
+ }
+
+ public override void doAction(DoAction tag)
+ {
+ int adjust = 0;
+ if (Debug)
+ {
+ adjust = writer.Pos + 6;
+ debug.adjust += adjust;
+ }
+
+ new ActionEncoder(tagw, debug).encode(tag.actionList);
+ tagw.writeUI8(0);
+ encodeTag(tag);
+
+ if (Debug)
+ {
+ debug.adjust -= adjust;
+ }
+ }
+
+ public override void doInitAction(DoInitAction tag)
+ {
+ int adjust = 0;
+ if (Debug)
+ {
+ adjust = writer.Pos + 6;
+ debug.adjust += adjust;
+ }
+
+ int idref = dict.getId(tag.sprite);
+ tagw.writeUI16(idref);
+ new ActionEncoder(tagw, debug).encode(tag.actionList);
+ tagw.writeUI8(0);
+ encodeTag(tag);
+
+ if (Debug)
+ {
+ debug.adjust -= adjust;
+ }
+ }
+
+ public override void enableDebugger(EnableDebugger tag)
+ {
+ tagw.writeString(tag.password);
+ encodeTag(tag);
+ }
+
+ public override void enableDebugger2(EnableDebugger tag)
+ {
+ // This corresponds to the constant used in the player,
+ // core/splay.cpp, in ScriptThread::EnableDebugger().
+ tagw.writeUI16(0x1975);
+ tagw.writeString(tag.password);
+ encodeTag(tag);
+ }
+
+ public override void exportAssets(ExportAssets tag)
+ {
+ tagw.writeUI16(tag.exports.Count);
+ System.Collections.IEnumerator it = tag.exports.GetEnumerator();
+ //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
+ while (it.MoveNext())
+ {
+ //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
+ DefineTag ref_Renamed = (DefineTag) it.Current;
+ int idref = dict.getId(ref_Renamed);
+ tagw.writeUI16(idref);
+ assert(ref_Renamed.name != null); // exported symbols must have names
+ tagw.writeString(ref_Renamed.name);
+ dict.addName(ref_Renamed, ref_Renamed.name);
+ }
+ encodeTag(tag);
+ }
+
+ public override void symbolClass(SymbolClass tag)
+ {
+ tagw.writeUI16(tag.class2tag.Count + (tag.topLevelClass != null?1:0));
+ //UPGRADE_TODO: Method 'java.util.Map.entrySet' was converted to 'SupportClass.HashSetSupport' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilMapentrySet'"
+ System.Collections.IEnumerator it = new SupportClass.HashSetSupport(tag.class2tag).GetEnumerator();
+ //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
+ while (it.MoveNext())
+ {
+ //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
+ System.Collections.DictionaryEntry e = (System.Collections.DictionaryEntry) it.Current;
+ System.String name = (System.String) e.Key;
+ DefineTag ref_Renamed = (DefineTag) e.Value;
+
+ int idref = dict.getId(ref_Renamed);
+ tagw.writeUI16(idref);
+ tagw.writeString(name);
+ }
+ if (tag.topLevelClass != null)
+ {
+ tagw.writeUI16(0);
+ tagw.writeString(tag.topLevelClass);
+ }
+ encodeTag(tag);
+ }
+
+ public override void frameLabel(FrameLabel tag)
+ {
+ tagw.writeString(tag.label);
+ if (tag.anchor && SwfVersion >= 6)
+ {
+ tagw.writeUI8(1);
+ }
+ encodeTag(tag);
+ }
+
+ public override void importAssets(ImportAssets tag)
+ {
+ tagw.writeString(tag.url);
+ if (tag.code == flash.swf.TagValues_Fields.stagImportAssets2)
+ {
+ tagw.writeUI8(tag.downloadNow?1:0);
+ tagw.writeUI8(tag.SHA1 != null?1:0);
+ if (tag.SHA1 != null)
+ {
+ tagw.write(tag.SHA1);
+ }
+ }
+ tagw.writeUI16(tag.importRecords.Count);
+ System.Collections.IEnumerator it = tag.importRecords.GetEnumerator();
+ //UPGRADE_TODO: Method 'java.util.Iterator.hasNext' was converted to 'System.Collections.IEnumerator.MoveNext' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratorhasNext'"
+ while (it.MoveNext())
+ {
+ //UPGRADE_TODO: Method 'java.util.Iterator.next' was converted to 'System.Collections.IEnumerator.Current' which has a different behavior. "ms-help://MS.VSCC.v80/dv_commoner/local/redirect.htm?index='!DefaultContextWindowIndex'&keyword='jlca1073_javautilIteratornext'"
+ ImportRecord record = (ImportRecord) it.Current;
+ int id = dict.add(record);
+ tagw.writeUI16(id);
+ tagw.writeString(record.name);
+ }
+ encodeTag(tag);
+ }
+
+ public override void importAssets2(ImportAssets tag)
+ {
+ importAssets(tag);
+ }
+
+ public override void jpegTables(GenericTag tag)
+ {
+ encodeTagHeader(tag.code, tag.data.Length, false);
+ writer.write(tag.data);
+ }
+
+ public override void placeObject(PlaceObject tag)
+ {
+ int idref = dict.getId(tag.ref_Renamed);
+ tagw.writeUI16(idref);
+ tagw.writeUI16(tag.depth);
+ encodeMatrix(tag.matrix, tagw);
+ if (tag.colorTransform != null)
+ {
+ encodeCxform(tag.colorTransform, tagw);
+ }
+ encodeTag(tag);
+ }
+
+ public override void placeObject2(PlaceObject tag)
+ {
+ placeObject23(tag);
+ }
+
+ public override void placeObject3(PlaceObject tag)
+ {
+ placeObject23(tag);
+ }
+
+ public virtual void placeObject23(PlaceObject tag)
+ {
+ tagw.writeUI8(tag.flags);
+ if (tag.code == flash.swf.TagValues_Fields.stagPlaceObject3)
+ {
+ tagw.writeUI8(tag.flags2);
+ }
+ tagw.writeUI16(tag.depth);
+ if (tag.hasClassName())
+ {
+ tagw.writeString(tag.className);
+ }
+ if (tag.hasCharID())
+ {
+ int idref = dict.getId(tag.ref_Renamed);
+ tagw.writeUI16(idref);
+ }
+ if (tag.hasMatrix())
+ {
+ encodeMatrix(tag.matrix, tagw);
+ }
+ if (tag.hasCxform())
+ {
+ // ed 5/22/03 the SWF 6 file format spec says this should be a CXFORM, but
+ // the spec is wrong. the player expects a CXFORMA.
+ encodeCxforma(((CXFormWithAlpha) tag.colorTransform), tagw);
+ }
+ if (tag.hasRatio())
+ {
+ tagw.writeUI16(tag.ratio);
+ }
+ if (tag.hasName())
+ {
+ tagw.writeString(tag.name);
+ }
+ if (tag.hasClipDepth())
+ {
+ tagw.writeUI16(tag.clipDepth);
+ }
+ if (tag.code == flash.swf.TagValues_Fields.stagPlaceObject3)
+ {
+ if (tag.hasFilterList())
+ {
+ encodeFilterList(tag.filters, tagw);
+ }
+ if (tag.hasBlendMode())
+ {
+ tagw.writeUI8(tag.blendMode);
+ }
+ }
+ if (tag.hasClipAction())
+ {
+ int adjust = 0;
+ if (Debug)
+ {
+ adjust = writer.Pos + 6;
+ debug.adjust += adjust;
+ }
+ new ActionEncoder(tagw, debug).encodeClipActions(tag.clipActions);
+ if (Debug)
+ {
+ debug.adjust -= adjust;
+ }
+ }
+ encodeTag(tag);
+ }
+
+ public override void protect(GenericTag tag)
+ {
+ if (tag.data != null)
+ {
+ encodeTagHeader(tag.code, tag.data.Length, false);
+ writer.write(tag.data);
+ }
+ else
+ {
+ encodeTagHeader(tag.code, 0, false);
+ }
+ }
+
+ public override void removeObject(RemoveObject tag)
+ {
+ encodeTagHeader(tag.code, 4, false);
+ int idref = dict.getId(tag.ref_Renamed);
+ writer.writeUI16(idref);
+ writer.writeUI16(tag.depth);
+ }
+
+ public override void removeObject2(RemoveObject tag)
+ {
+ encodeTagHeader(tag.code, 2, false);
+ writer.writeUI16(tag.depth);
+ }
+
+ public override void showFrame(ShowFrame tag)
+ {
+ encodeTagHeader(tag.code, 0, false);
+ frames++;
+ }
+
+ public override void soundStreamBlock(GenericTag tag)
+ {
+ encodeTagHeader(tag.code, tag.data.Length, false);
+ writer.write(tag.data);
+ }
+
+ public override void soundStreamHead(SoundStreamHead tag)
+ {
+ int length = 4;
+
+ // we need to add two bytes for an extra SI16 (latencySeek)
+ if (tag.compression == SoundStreamHead.sndCompressMP3)
+ {
+ length += 2;
+ }
+
+ encodeTagHeader(tag.code, length, false);
+
+ // 1 byte
+ writer.writeUBits(0, 4); // reserved
+ writer.writeUBits(tag.playbackRate, 2);
+ writer.writeUBits(tag.playbackSize, 1);
+ writer.writeUBits(tag.playbackType, 1);
+
+ // 1 byte
+ writer.writeUBits(tag.compression, 4);
+ writer.writeUBits(tag.streamRate, 2);
+ writer.writeUBits(tag.streamSize, 1);
+ writer.writeUBits(tag.streamType, 1);
+
+ // 2 bytes
+ writer.writeUI16(tag.streamSampleCount);
+
+ if (tag.compression == SoundStreamHead.sndCompressMP3)
+ {
+ // 2 bytes
+ writer.writeSI16(tag.latencySeek);
+ }
+ }
+
+ public override void soundStreamHead2(SoundStreamHead tag)
+ {
+ soundStreamHead(tag);
+ }
+
+ public override void startSound(StartSound tag)
+ {
+ int idref = dict.getId(tag.sound);
+ tagw.writeUI16(idref);
+ encodeSoundInfo(tag.soundInfo, tagw);
+ encodeTag(tag);
+ }
+
+ public override void videoFrame(VideoFrame tag)
+ {
+ encodeTagHeader(tag.code, 4 + tag.videoData.Length, false);
+ int idref = dict.getId(tag.stream);
+ writer.writeUI16(idref);
+ writer.writeUI16(tag.frameNum);
+ writer.write(tag.videoData);
+ }
+
+ public override void defineSceneAndFrameLabelData(DefineSceneAndFrameLabelData tag)
+ {
+ encodeTagHeader(tag.code, tag.data.Length, false);
+ writer.write(tag.data);
+ }
+
+ public override void doABC(DoABC tag)
+ {
+ if (tag.code == flash.swf.TagValues_Fields.stagDoABC2)
+ {
+ encodeTagHeader(tag.code, 4 + tag.name.Length + 1 + tag.abc.Length, false);
+ writer.write32(tag.flag);
+ writer.writeString(tag.name);
+ }
+ else
+ {
+ encodeTagHeader(tag.code, tag.abc.Length, false);
+ }
+
+ writer.write(tag.abc);
+ }
+
+ public override void unknown(GenericTag tag)
+ {
+ encodeTagHeader(tag.code, tag.data.Length, false);
+ writer.write(tag.data);
+ }
+
+ public virtual sbyte[] toByteArray()
+ {
+ //TODO this could be improved, tricky bit is that writeTo is not trivial
+ // and has the side effect of compressing (meaning the writer.size()
+ // may be larger than necessary)
+ System.IO.MemoryStream out_Renamed = new System.IO.MemoryStream(writer.Length);
+ writeTo(out_Renamed);
+ return SupportClass.ToSByteArray(out_Renamed.ToArray());
+ }
+
+ public override void scriptLimits(ScriptLimits tag)
+ {
+ tagw.writeUI16(tag.scriptRecursionLimit);
+ tagw.writeUI16(tag.scriptTimeLimit);
+ encodeTag(tag);
+ }
+ }
}
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/110 ActionScript 3 - Flash IDE Project/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/110 ActionScript 3 - Flash IDE Project/Project.as3proj
new file mode 100644
index 0000000000..71f47c7559
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/110 ActionScript 3 - Flash IDE Project/Project.as3proj
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/110 ActionScript 3 - Flash IDE Project/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/110 ActionScript 3 - Flash IDE Project/Project.png
new file mode 100644
index 0000000000..d1c3fe6222
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/110 ActionScript 3 - Flash IDE Project/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/110 ActionScript 3 - Flash IDE Project/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/110 ActionScript 3 - Flash IDE Project/Project.txt
new file mode 100644
index 0000000000..645e307742
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/110 ActionScript 3 - Flash IDE Project/Project.txt
@@ -0,0 +1 @@
+An empty project written in ActionScript 3 with compilation using the Flash IDE
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/Project.as3proj
new file mode 100644
index 0000000000..e8ed942628
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/Project.as3proj
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/Project.png
new file mode 100644
index 0000000000..bf1262c6e8
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/Project.txt
new file mode 100644
index 0000000000..a6eb1f267c
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/Project.txt
@@ -0,0 +1 @@
+A project written in ActionScript 3 for the Flash 9+ Player
\ No newline at end of file
diff --git a/FlashDevelop/Bin/Debug/Projects/310 Haxe - AS3 Project/bin/expressInstall.swf b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/bin/expressInstall.swf
similarity index 100%
rename from FlashDevelop/Bin/Debug/Projects/310 Haxe - AS3 Project/bin/expressInstall.swf
rename to External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/bin/expressInstall.swf
diff --git a/FlashDevelop/Bin/Debug/Projects/310 Haxe - AS3 Project/bin/index.html.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/bin/index.html.template
similarity index 100%
rename from FlashDevelop/Bin/Debug/Projects/310 Haxe - AS3 Project/bin/index.html.template
rename to External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/bin/index.html.template
diff --git a/FlashDevelop/Bin/Debug/Projects/310 Haxe - AS3 Project/bin/js/swfobject.js b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/bin/js/swfobject.js
similarity index 100%
rename from FlashDevelop/Bin/Debug/Projects/310 Haxe - AS3 Project/bin/js/swfobject.js
rename to External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/bin/js/swfobject.js
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/src/$(PackagePath)/Main.as.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/src/$(PackagePath)/Main.as.template
new file mode 100644
index 0000000000..47dbeffff5
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/120 ActionScript 3 - AS3 Project/src/$(PackagePath)/Main.as.template
@@ -0,0 +1,23 @@
+package $(PackageName)$(CSLB){
+ import flash.display.Sprite;
+ import flash.events.Event;
+
+ /**
+ $(CBI)* ...
+ $(CBI)* @author $(DefaultUser)
+ $(CBI)*/
+ public class Main extends Sprite $(CSLB){
+
+ public function Main() $(CSLB){
+ if (stage) init();
+ else addEventListener(Event.ADDED_TO_STAGE, init);
+ }
+
+ private function init(e:Event = null):void $(CSLB){
+ removeEventListener(Event.ADDED_TO_STAGE, init);
+ // entry point
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/Project.as3proj
new file mode 100644
index 0000000000..e8ed942628
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/Project.as3proj
@@ -0,0 +1,58 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/Project.png
new file mode 100644
index 0000000000..08c1d7238c
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/Project.txt
new file mode 100644
index 0000000000..82ae7b6d46
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/Project.txt
@@ -0,0 +1 @@
+A project written in ActionScript 3 for the Flash 9+ Player - optimized with a preloader
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/bin/expressInstall.swf b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/bin/expressInstall.swf
new file mode 100644
index 0000000000..86958bf3a7
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/bin/expressInstall.swf differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/bin/index.html.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/bin/index.html.template
new file mode 100644
index 0000000000..d07510f497
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/bin/index.html.template
@@ -0,0 +1,40 @@
+
+
+
+
+ $(ProjectName)
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/bin/js/swfobject.js b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/bin/js/swfobject.js
new file mode 100644
index 0000000000..8eafe9dd83
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/130 ActionScript 3 - AS3 Project with Preloader/bin/js/swfobject.js
@@ -0,0 +1,4 @@
+/* SWFObject v2.2
+ is released under the MIT License
+*/
+var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad '}}aa.outerHTML='"+af+" ";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ build.bat "$(CompilerPath)"
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/Project.png
new file mode 100644
index 0000000000..bf1262c6e8
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/Project.txt
new file mode 100644
index 0000000000..41d7c6a41e
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/Project.txt
@@ -0,0 +1 @@
+An ActionScript 3 library (SWC) project to compile with an 'ant' script.
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/build.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/build.bat
new file mode 100644
index 0000000000..223f8d56d4
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/build.bat
@@ -0,0 +1,8 @@
+@echo off
+
+:: set environment
+if not "%~1"=="" set FLEX_HOME=%~1
+
+:: build
+echo build with %FLEX_HOME%
+ant
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/build.xml.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/build.xml.template
new file mode 100644
index 0000000000..c279f53bcc
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/build.xml.template
@@ -0,0 +1,41 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/FlashDevelop/Bin/Debug/Projects/315 Haxe - AIR AS3 Projector/bin/.empty b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/lib/.empty
similarity index 100%
rename from FlashDevelop/Bin/Debug/Projects/315 Haxe - AIR AS3 Projector/bin/.empty
rename to External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/lib/.empty
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/src/$(PackagePath)/$(ProjectID).as.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/src/$(PackagePath)/$(ProjectID).as.template
new file mode 100644
index 0000000000..5da7c3a3b7
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/135 ActionScript 3 - AS3 Library SWC/src/$(PackagePath)/$(ProjectID).as.template
@@ -0,0 +1,15 @@
+package $(PackageName)$(CSLB){
+
+ /**
+ $(CBI)* ...
+ $(CBI)* @author $(DefaultUser)
+ $(CBI)*/
+ public class $(ProjectID) {
+
+ public function $(ProjectID)() $(CSLB){
+
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/Project.as3proj
new file mode 100644
index 0000000000..12669b4be5
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/Project.as3proj
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/Project.png
new file mode 100644
index 0000000000..8dc30ca1af
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/Project.txt
new file mode 100644
index 0000000000..35a213b47d
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/Project.txt
@@ -0,0 +1 @@
+An ActionScript 3 project that uses MXML and the Flex 3 Framework
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/bin/expressInstall.swf b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/bin/expressInstall.swf
new file mode 100644
index 0000000000..86958bf3a7
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/bin/expressInstall.swf differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/bin/index.html.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/bin/index.html.template
new file mode 100644
index 0000000000..d07510f497
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/bin/index.html.template
@@ -0,0 +1,40 @@
+
+
+
+
+ $(ProjectName)
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/bin/js/swfobject.js b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/bin/js/swfobject.js
new file mode 100644
index 0000000000..8eafe9dd83
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/140 ActionScript 3 - Flex 3 Project/bin/js/swfobject.js
@@ -0,0 +1,4 @@
+/* SWFObject v2.2
+ is released under the MIT License
+*/
+var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad '}}aa.outerHTML='"+af+" ";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/Project.as3proj
new file mode 100644
index 0000000000..a963c6b5b3
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/Project.as3proj
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/Project.png
new file mode 100644
index 0000000000..33031dea06
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/Project.txt
new file mode 100644
index 0000000000..30a7e620b5
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/Project.txt
@@ -0,0 +1 @@
+An ActionScript 3 project that uses MXML and the Flex 4 Framework
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/bin/expressInstall.swf b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/bin/expressInstall.swf
new file mode 100644
index 0000000000..86958bf3a7
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/bin/expressInstall.swf differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/bin/index.html.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/bin/index.html.template
new file mode 100644
index 0000000000..d07510f497
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/bin/index.html.template
@@ -0,0 +1,40 @@
+
+
+
+
+ $(ProjectName)
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/bin/js/swfobject.js b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/bin/js/swfobject.js
new file mode 100644
index 0000000000..8eafe9dd83
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/150 ActionScript 3 - Flex 4 Project/bin/js/swfobject.js
@@ -0,0 +1,4 @@
+/* SWFObject v2.2
+ is released under the MIT License
+*/
+var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad '}}aa.outerHTML='"+af+" ";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/AIR_readme.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/AIR_readme.txt
new file mode 100644
index 0000000000..75d1a6acdb
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/AIR_readme.txt
@@ -0,0 +1,20 @@
+AIR for desktop instructions
+
+1. Configuration
+
+ - edit 'bat\SetupSDK.bat' for the path to Flex SDK (defaults should be ok)
+
+
+2. Creating a self-signed certificate:
+
+ - run 'bat\CreateCertificate.bat' to generate your self-signed certificate,
+
+ (!) wait a minute before packaging.
+
+
+3. Run/debug from FlashDevelop as usual (build F8, build&run F5 or Ctrl+Enter)
+
+
+4. Packaging for release:
+
+ - run 'bat\PackageApp.bat' to only create the AIR setup
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/Project.as3proj
new file mode 100644
index 0000000000..27c6e874ac
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/Project.as3proj
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/Project.png
new file mode 100644
index 0000000000..5cad22b601
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/Project.txt
new file mode 100644
index 0000000000..242a035de9
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/Project.txt
@@ -0,0 +1 @@
+An AIR projector written in ActionScript 3
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/application.xml.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/application.xml.template
new file mode 100644
index 0000000000..24c7106b31
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/application.xml.template
@@ -0,0 +1,27 @@
+
+
+
+ $(PACKAGEDOT)$(PROJECTID)
+ 1.0
+ $(PROJECTID)
+
+ $(PROJECTNAME)
+
+
+
+
+ $(PROJECTNAME)
+ $(PROJECTID).swf
+ standard
+ false
+ true
+ true
+ true
+ true
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/CreateCertificate.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/CreateCertificate.bat
new file mode 100644
index 0000000000..f9a51a57f9
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/CreateCertificate.bat
@@ -0,0 +1,34 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+:: Generate
+echo.
+echo Generating a self-signed certificate...
+call adt -certificate -cn %CERT_NAME% 2048-RSA %CERT_FILE% %CERT_PASS%
+if errorlevel 1 goto failed
+
+:succeed
+echo.
+echo Certificate created: %CERT_FILE% with password "%CERT_PASS%"
+echo.
+if "%CERT_PASS%" == "fd" echo Note: You did not change the default password
+echo.
+echo HINTS:
+echo - you only need to generate this certificate once,
+echo - wait a minute before using this certificate to package your AIR application.
+echo.
+goto end
+
+:failed
+echo.
+echo Certificate creation FAILED.
+echo.
+
+:end
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/PackageApp.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/PackageApp.bat
new file mode 100644
index 0000000000..59aed98b63
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/PackageApp.bat
@@ -0,0 +1,15 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+set AIR_TARGET=
+::set AIR_TARGET=-captive-runtime
+set OPTIONS=-tsa none
+call bat\Packager.bat
+
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/Packager.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/Packager.bat
new file mode 100644
index 0000000000..03a520e1a7
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/Packager.bat
@@ -0,0 +1,39 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+if not exist %CERT_FILE% goto certificate
+
+:: AIR output
+if not exist %AIR_PATH% md %AIR_PATH%
+set OUTPUT=%AIR_PATH%\%AIR_NAME%%AIR_TARGET%.air
+
+:: Package
+echo.
+echo Packaging %AIR_NAME%%AIR_TARGET%.air using certificate %CERT_FILE%...
+call adt -package %OPTIONS% %SIGNING_OPTIONS% %OUTPUT% %APP_XML% %FILE_OR_DIR%
+if errorlevel 1 goto failed
+goto end
+
+:certificate
+echo.
+echo Certificate not found: %CERT_FILE%
+echo.
+echo Troubleshooting:
+echo - generate a default certificate using 'bat\CreateCertificate.bat'
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:failed
+echo AIR setup creation FAILED.
+echo.
+echo Troubleshooting:
+echo - verify AIR SDK target version in %APP_XML%
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:end
+echo.
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/RunApp.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/RunApp.bat
new file mode 100644
index 0000000000..5b00357b4f
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/RunApp.bat
@@ -0,0 +1,21 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+echo.
+echo Starting AIR Debug Launcher...
+echo.
+
+adl "%APP_XML%" "%APP_DIR%"
+if errorlevel 1 goto error
+goto end
+
+:error
+pause
+
+:end
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/SetupApp.bat.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/SetupApp.bat.template
new file mode 100644
index 0000000000..afe57569cc
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/SetupApp.bat.template
@@ -0,0 +1,47 @@
+:: Set working dir
+cd %~dp0 & cd ..
+
+:user_configuration
+
+:: About AIR application packaging
+:: http://livedocs.adobe.com/flex/3/html/help.html?content=CommandLineTools_5.html#1035959
+:: http://livedocs.adobe.com/flex/3/html/distributing_apps_4.html#1037515
+
+:: NOTICE: all paths are relative to project root
+
+:: Your certificate information
+set CERT_NAME="$(PROJECTNAME)"
+set CERT_PASS=fd
+set CERT_FILE="bat\$(PROJECTID).p12"
+set SIGNING_OPTIONS=-storetype pkcs12 -keystore %CERT_FILE% -storepass %CERT_PASS%
+
+:: Application descriptor
+set APP_XML=application.xml
+
+:: Files to package
+set APP_DIR=bin
+set FILE_OR_DIR=-C %APP_DIR% .
+
+:: Your application ID (must match of Application descriptor) and remove spaces
+for /f "tokens=3 delims=<>" %%a in ('findstr /R /C:"^[ ]*" %APP_XML%') do set APP_ID=%%a
+set APP_ID=%APP_ID: =%
+
+:: Output
+set AIR_PATH=air
+set AIR_NAME=$(PROJECTID)
+
+:validation
+findstr /C:"%APP_ID% " "%APP_XML%" > NUL
+if errorlevel 1 goto badid
+goto end
+
+:badid
+echo.
+echo ERROR:
+echo Application ID in 'bat\SetupApp.bat' (APP_ID)
+echo does NOT match Application descriptor '%APP_XML%' (id)
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:end
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/SetupSDK.bat.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/SetupSDK.bat.template
new file mode 100644
index 0000000000..55942b9136
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bat/SetupSDK.bat.template
@@ -0,0 +1,26 @@
+:: Set working dir
+cd %~dp0 & cd ..
+
+:user_configuration
+
+:: Static path to Flex SDK
+set FLEX_SDK=$(FlexSDK)
+
+:: Use FD supplied SDK path if executed from FD
+if exist "%FD_CUR_SDK%" set FLEX_SDK=%FD_CUR_SDK%
+
+:validation
+if not exist "%FLEX_SDK%\bin" goto flexsdk
+goto succeed
+
+:flexsdk
+echo.
+echo ERROR: incorrect path to Flex SDK in 'bat\SetupSDK.bat'
+echo.
+echo Looking for: %FLEX_SDK%\bin
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:succeed
+set PATH=%FLEX_SDK%\bin;%PATH%
diff --git a/FlashDevelop/Bin/Debug/Projects/370 Haxe - NME Project/assets/img/.empty b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bin/.empty
similarity index 100%
rename from FlashDevelop/Bin/Debug/Projects/370 Haxe - NME Project/assets/img/.empty
rename to External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/bin/.empty
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/src/$(PackagePath)/Main.as.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/src/$(PackagePath)/Main.as.template
new file mode 100644
index 0000000000..3d011abc2c
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/160 ActionScript 3 - AIR AS3 Projector/src/$(PackagePath)/Main.as.template
@@ -0,0 +1,16 @@
+package $(PackageName)$(CSLB){
+ import flash.display.Sprite;
+
+ /**
+ $(CBI)* ...
+ $(CBI)* @author $(DefaultUser)
+ $(CBI)*/
+ public class Main extends Sprite $(CSLB){
+
+ public function Main() $(CSLB){
+
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/AIR_readme.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/AIR_readme.txt
new file mode 100644
index 0000000000..75d1a6acdb
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/AIR_readme.txt
@@ -0,0 +1,20 @@
+AIR for desktop instructions
+
+1. Configuration
+
+ - edit 'bat\SetupSDK.bat' for the path to Flex SDK (defaults should be ok)
+
+
+2. Creating a self-signed certificate:
+
+ - run 'bat\CreateCertificate.bat' to generate your self-signed certificate,
+
+ (!) wait a minute before packaging.
+
+
+3. Run/debug from FlashDevelop as usual (build F8, build&run F5 or Ctrl+Enter)
+
+
+4. Packaging for release:
+
+ - run 'bat\PackageApp.bat' to only create the AIR setup
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/Project.as3proj
new file mode 100644
index 0000000000..8f00e65ec1
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/Project.as3proj
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/Project.png
new file mode 100644
index 0000000000..5cad22b601
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/Project.txt
new file mode 100644
index 0000000000..aa90493fb8
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/Project.txt
@@ -0,0 +1 @@
+An AIR projector that uses MXML and the Flex 3 Framework
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/application.xml.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/application.xml.template
new file mode 100644
index 0000000000..8f56518ea0
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/application.xml.template
@@ -0,0 +1,27 @@
+
+
+
+ $(PACKAGEDOT)$(PROJECTID)
+ 1.0
+ $(PROJECTID)
+
+ $(PROJECTNAME)
+
+
+
+
+ $(PROJECTNAME)
+ $(PROJECTID).swf
+ standard
+ false
+ true
+ true
+ true
+ true
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/CreateCertificate.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/CreateCertificate.bat
new file mode 100644
index 0000000000..f9a51a57f9
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/CreateCertificate.bat
@@ -0,0 +1,34 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+:: Generate
+echo.
+echo Generating a self-signed certificate...
+call adt -certificate -cn %CERT_NAME% 2048-RSA %CERT_FILE% %CERT_PASS%
+if errorlevel 1 goto failed
+
+:succeed
+echo.
+echo Certificate created: %CERT_FILE% with password "%CERT_PASS%"
+echo.
+if "%CERT_PASS%" == "fd" echo Note: You did not change the default password
+echo.
+echo HINTS:
+echo - you only need to generate this certificate once,
+echo - wait a minute before using this certificate to package your AIR application.
+echo.
+goto end
+
+:failed
+echo.
+echo Certificate creation FAILED.
+echo.
+
+:end
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/PackageApp.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/PackageApp.bat
new file mode 100644
index 0000000000..59aed98b63
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/PackageApp.bat
@@ -0,0 +1,15 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+set AIR_TARGET=
+::set AIR_TARGET=-captive-runtime
+set OPTIONS=-tsa none
+call bat\Packager.bat
+
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/Packager.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/Packager.bat
new file mode 100644
index 0000000000..03a520e1a7
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/Packager.bat
@@ -0,0 +1,39 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+if not exist %CERT_FILE% goto certificate
+
+:: AIR output
+if not exist %AIR_PATH% md %AIR_PATH%
+set OUTPUT=%AIR_PATH%\%AIR_NAME%%AIR_TARGET%.air
+
+:: Package
+echo.
+echo Packaging %AIR_NAME%%AIR_TARGET%.air using certificate %CERT_FILE%...
+call adt -package %OPTIONS% %SIGNING_OPTIONS% %OUTPUT% %APP_XML% %FILE_OR_DIR%
+if errorlevel 1 goto failed
+goto end
+
+:certificate
+echo.
+echo Certificate not found: %CERT_FILE%
+echo.
+echo Troubleshooting:
+echo - generate a default certificate using 'bat\CreateCertificate.bat'
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:failed
+echo AIR setup creation FAILED.
+echo.
+echo Troubleshooting:
+echo - verify AIR SDK target version in %APP_XML%
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:end
+echo.
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/RunApp.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/RunApp.bat
new file mode 100644
index 0000000000..5b00357b4f
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/RunApp.bat
@@ -0,0 +1,21 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+echo.
+echo Starting AIR Debug Launcher...
+echo.
+
+adl "%APP_XML%" "%APP_DIR%"
+if errorlevel 1 goto error
+goto end
+
+:error
+pause
+
+:end
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/SetupApp.bat.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/SetupApp.bat.template
new file mode 100644
index 0000000000..afe57569cc
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/SetupApp.bat.template
@@ -0,0 +1,47 @@
+:: Set working dir
+cd %~dp0 & cd ..
+
+:user_configuration
+
+:: About AIR application packaging
+:: http://livedocs.adobe.com/flex/3/html/help.html?content=CommandLineTools_5.html#1035959
+:: http://livedocs.adobe.com/flex/3/html/distributing_apps_4.html#1037515
+
+:: NOTICE: all paths are relative to project root
+
+:: Your certificate information
+set CERT_NAME="$(PROJECTNAME)"
+set CERT_PASS=fd
+set CERT_FILE="bat\$(PROJECTID).p12"
+set SIGNING_OPTIONS=-storetype pkcs12 -keystore %CERT_FILE% -storepass %CERT_PASS%
+
+:: Application descriptor
+set APP_XML=application.xml
+
+:: Files to package
+set APP_DIR=bin
+set FILE_OR_DIR=-C %APP_DIR% .
+
+:: Your application ID (must match of Application descriptor) and remove spaces
+for /f "tokens=3 delims=<>" %%a in ('findstr /R /C:"^[ ]*" %APP_XML%') do set APP_ID=%%a
+set APP_ID=%APP_ID: =%
+
+:: Output
+set AIR_PATH=air
+set AIR_NAME=$(PROJECTID)
+
+:validation
+findstr /C:"%APP_ID% " "%APP_XML%" > NUL
+if errorlevel 1 goto badid
+goto end
+
+:badid
+echo.
+echo ERROR:
+echo Application ID in 'bat\SetupApp.bat' (APP_ID)
+echo does NOT match Application descriptor '%APP_XML%' (id)
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:end
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/SetupSDK.bat.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/SetupSDK.bat.template
new file mode 100644
index 0000000000..55942b9136
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bat/SetupSDK.bat.template
@@ -0,0 +1,26 @@
+:: Set working dir
+cd %~dp0 & cd ..
+
+:user_configuration
+
+:: Static path to Flex SDK
+set FLEX_SDK=$(FlexSDK)
+
+:: Use FD supplied SDK path if executed from FD
+if exist "%FD_CUR_SDK%" set FLEX_SDK=%FD_CUR_SDK%
+
+:validation
+if not exist "%FLEX_SDK%\bin" goto flexsdk
+goto succeed
+
+:flexsdk
+echo.
+echo ERROR: incorrect path to Flex SDK in 'bat\SetupSDK.bat'
+echo.
+echo Looking for: %FLEX_SDK%\bin
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:succeed
+set PATH=%FLEX_SDK%\bin;%PATH%
diff --git a/FlashDevelop/Bin/Debug/Projects/370 Haxe - NME Project/bin/.empty b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bin/.empty
similarity index 100%
rename from FlashDevelop/Bin/Debug/Projects/370 Haxe - NME Project/bin/.empty
rename to External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/bin/.empty
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/src/$(PackagePath)/Main.mxml b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/src/$(PackagePath)/Main.mxml
new file mode 100644
index 0000000000..38f80a3fc9
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/170 ActionScript 3 - AIR Flex 3 Projector/src/$(PackagePath)/Main.mxml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/AIR_readme.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/AIR_readme.txt
new file mode 100644
index 0000000000..75d1a6acdb
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/AIR_readme.txt
@@ -0,0 +1,20 @@
+AIR for desktop instructions
+
+1. Configuration
+
+ - edit 'bat\SetupSDK.bat' for the path to Flex SDK (defaults should be ok)
+
+
+2. Creating a self-signed certificate:
+
+ - run 'bat\CreateCertificate.bat' to generate your self-signed certificate,
+
+ (!) wait a minute before packaging.
+
+
+3. Run/debug from FlashDevelop as usual (build F8, build&run F5 or Ctrl+Enter)
+
+
+4. Packaging for release:
+
+ - run 'bat\PackageApp.bat' to only create the AIR setup
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/Project.as3proj
new file mode 100644
index 0000000000..72242b4dd2
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/Project.as3proj
@@ -0,0 +1,83 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/Project.png
new file mode 100644
index 0000000000..5cad22b601
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/Project.txt
new file mode 100644
index 0000000000..48c6e87f13
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/Project.txt
@@ -0,0 +1 @@
+An AIR projector that uses MXML and the Flex 4 Framework
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/application.xml.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/application.xml.template
new file mode 100644
index 0000000000..25f8745565
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/application.xml.template
@@ -0,0 +1,27 @@
+
+
+
+ $(PACKAGEDOT)$(PROJECTID)
+ 1.0
+ $(PROJECTID)
+
+ $(PROJECTNAME)
+
+
+
+
+ $(PROJECTNAME)
+ $(PROJECTID).swf
+ standard
+ false
+ true
+ true
+ true
+ true
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/CreateCertificate.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/CreateCertificate.bat
new file mode 100644
index 0000000000..f9a51a57f9
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/CreateCertificate.bat
@@ -0,0 +1,34 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+:: Generate
+echo.
+echo Generating a self-signed certificate...
+call adt -certificate -cn %CERT_NAME% 2048-RSA %CERT_FILE% %CERT_PASS%
+if errorlevel 1 goto failed
+
+:succeed
+echo.
+echo Certificate created: %CERT_FILE% with password "%CERT_PASS%"
+echo.
+if "%CERT_PASS%" == "fd" echo Note: You did not change the default password
+echo.
+echo HINTS:
+echo - you only need to generate this certificate once,
+echo - wait a minute before using this certificate to package your AIR application.
+echo.
+goto end
+
+:failed
+echo.
+echo Certificate creation FAILED.
+echo.
+
+:end
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/PackageApp.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/PackageApp.bat
new file mode 100644
index 0000000000..59aed98b63
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/PackageApp.bat
@@ -0,0 +1,15 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+set AIR_TARGET=
+::set AIR_TARGET=-captive-runtime
+set OPTIONS=-tsa none
+call bat\Packager.bat
+
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/Packager.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/Packager.bat
new file mode 100644
index 0000000000..03a520e1a7
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/Packager.bat
@@ -0,0 +1,39 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+if not exist %CERT_FILE% goto certificate
+
+:: AIR output
+if not exist %AIR_PATH% md %AIR_PATH%
+set OUTPUT=%AIR_PATH%\%AIR_NAME%%AIR_TARGET%.air
+
+:: Package
+echo.
+echo Packaging %AIR_NAME%%AIR_TARGET%.air using certificate %CERT_FILE%...
+call adt -package %OPTIONS% %SIGNING_OPTIONS% %OUTPUT% %APP_XML% %FILE_OR_DIR%
+if errorlevel 1 goto failed
+goto end
+
+:certificate
+echo.
+echo Certificate not found: %CERT_FILE%
+echo.
+echo Troubleshooting:
+echo - generate a default certificate using 'bat\CreateCertificate.bat'
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:failed
+echo AIR setup creation FAILED.
+echo.
+echo Troubleshooting:
+echo - verify AIR SDK target version in %APP_XML%
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:end
+echo.
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/RunApp.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/RunApp.bat
new file mode 100644
index 0000000000..5b00357b4f
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/RunApp.bat
@@ -0,0 +1,21 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+echo.
+echo Starting AIR Debug Launcher...
+echo.
+
+adl "%APP_XML%" "%APP_DIR%"
+if errorlevel 1 goto error
+goto end
+
+:error
+pause
+
+:end
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/SetupApp.bat.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/SetupApp.bat.template
new file mode 100644
index 0000000000..afe57569cc
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/SetupApp.bat.template
@@ -0,0 +1,47 @@
+:: Set working dir
+cd %~dp0 & cd ..
+
+:user_configuration
+
+:: About AIR application packaging
+:: http://livedocs.adobe.com/flex/3/html/help.html?content=CommandLineTools_5.html#1035959
+:: http://livedocs.adobe.com/flex/3/html/distributing_apps_4.html#1037515
+
+:: NOTICE: all paths are relative to project root
+
+:: Your certificate information
+set CERT_NAME="$(PROJECTNAME)"
+set CERT_PASS=fd
+set CERT_FILE="bat\$(PROJECTID).p12"
+set SIGNING_OPTIONS=-storetype pkcs12 -keystore %CERT_FILE% -storepass %CERT_PASS%
+
+:: Application descriptor
+set APP_XML=application.xml
+
+:: Files to package
+set APP_DIR=bin
+set FILE_OR_DIR=-C %APP_DIR% .
+
+:: Your application ID (must match of Application descriptor) and remove spaces
+for /f "tokens=3 delims=<>" %%a in ('findstr /R /C:"^[ ]*" %APP_XML%') do set APP_ID=%%a
+set APP_ID=%APP_ID: =%
+
+:: Output
+set AIR_PATH=air
+set AIR_NAME=$(PROJECTID)
+
+:validation
+findstr /C:"%APP_ID% " "%APP_XML%" > NUL
+if errorlevel 1 goto badid
+goto end
+
+:badid
+echo.
+echo ERROR:
+echo Application ID in 'bat\SetupApp.bat' (APP_ID)
+echo does NOT match Application descriptor '%APP_XML%' (id)
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:end
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/SetupSDK.bat.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/SetupSDK.bat.template
new file mode 100644
index 0000000000..55942b9136
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bat/SetupSDK.bat.template
@@ -0,0 +1,26 @@
+:: Set working dir
+cd %~dp0 & cd ..
+
+:user_configuration
+
+:: Static path to Flex SDK
+set FLEX_SDK=$(FlexSDK)
+
+:: Use FD supplied SDK path if executed from FD
+if exist "%FD_CUR_SDK%" set FLEX_SDK=%FD_CUR_SDK%
+
+:validation
+if not exist "%FLEX_SDK%\bin" goto flexsdk
+goto succeed
+
+:flexsdk
+echo.
+echo ERROR: incorrect path to Flex SDK in 'bat\SetupSDK.bat'
+echo.
+echo Looking for: %FLEX_SDK%\bin
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:succeed
+set PATH=%FLEX_SDK%\bin;%PATH%
diff --git a/FlashDevelop/Bin/Debug/Templates/ProjectFiles/AS2Project/Empty File.txt.fdt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bin/.empty
similarity index 100%
rename from FlashDevelop/Bin/Debug/Templates/ProjectFiles/AS2Project/Empty File.txt.fdt
rename to External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/bin/.empty
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/src/$(PackagePath)/Main.mxml b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/src/$(PackagePath)/Main.mxml
new file mode 100644
index 0000000000..b1a0a9c28c
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/180 ActionScript 3 - AIR Flex 4 Projector/src/$(PackagePath)/Main.mxml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/AIR_Android_readme.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/AIR_Android_readme.txt
new file mode 100644
index 0000000000..3a50c8cc03
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/AIR_Android_readme.txt
@@ -0,0 +1,48 @@
+AIR for Android instructions
+
+1. Configuration:
+
+ - edit 'bat\SetupSDK.bat' for paths to Flex SDK and Android SDK (defaults should be ok)
+
+ - install your device's USB drivers:
+ http://developer.android.com/sdk/oem-usb.html
+ - enable "USB debugging" on your Android device:
+ Parameters > Applications > Development > USB Debugging
+
+
+2. Creating a self-signed certificate:
+
+ - run 'bat\CreateCertificate.bat' to generate your self-signed certificate,
+
+ (!) wait a minute before packaging.
+
+
+3. Build from FlashDevelop as usual (F8)
+
+
+4. Run/debug the application on the desktop as usual (F5 or Ctrl+Enter)
+
+
+5. Install AIR runtime on your device:
+
+ - run 'bat\InstallAirRuntime.bat'
+
+
+6. Running/debugging the application on the device:
+
+ 6.a. Build/Debug directly on device
+ - edit 'bat\RunApp.bat' and change the run target 'goto desktop' by 'goto android-debug'
+ - build & run as usual (Ctrl+Enter or F5) to package, install & run the application on your device
+
+ 6.b. Debug occasionally on device
+ - Debug-build from FlashDevelop (F8)
+ - run 'bat\PackageApp.bat' to package and install a debug version of the application
+ - start FlashDevelop debugger: Debug > Start Remote Session
+ - start the application on device
+ - the application should connect to FlashDevelop interactive debugger as usual
+
+
+7. Packaging for release:
+
+ - Release-build from FlashDevelop (F8)
+ - run 'bat\PackageApp.bat' and select Android/normal target
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/AIR_iOS_readme.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/AIR_iOS_readme.txt
new file mode 100644
index 0000000000..02d430c7fa
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/AIR_iOS_readme.txt
@@ -0,0 +1,75 @@
+AIR for iOS instructions
+
+1. Configuration:
+
+ - edit 'bat\SetupSDK.bat' for path to Flex SDK (defaults should be ok)
+
+3. Build from FlashDevelop as usual (F8)
+
+4. Run/debug the application on the desktop as usual (F5 or Ctrl+Enter)
+
+5. Configure for iOS packaging in 'bat\SetupApp.bat':
+
+ Take a deep breath, pay the Apple tax and read extra carefully this tutorial:
+ - http://www.codeandvisual.com/2011/exporting-for-iphone-using-air-27-and-flashdevelop-part-three-generating-developer-certificates-provisioning-profiles-and-p12-files/
+
+ Now this is how to create the p12 key entirely on Windows (steps 1. to 8.):
+ - http://connorullmann.com/2011/04/air-2-6-and-ios/
+
+ Then for each project you'll have to go to on Apple's iOS Provisioning Portal:
+ - create a new App ID with: name of the project and ID indicated in 'application.xml',
+ - create a new Provisioning Profile: select App ID & registered devices that will be allowed to install the app.
+
+ Once you have obtained a .p12 and .mobileprovision file from Apple's Provisioning Portal:
+ - save a copy of your .p12 and .mobileprovision certificates in the 'cert\' folder in your FlashDevelop project.
+ (make sure to keep an extra copy of these 2 files in a safe place)
+
+ Finally edit 'bat\SetupApp.bat' and complete the following lines:
+
+ - IOS_DEV_CERT_FILE: path to your iOS developer 'p12' key ('cert\' folder, if you have followed the instructions above)
+ - IOS_DEV_CERT_PASS: developer certificate's password
+ if you don't set it, remove "-storepass %IOS_DEV_CERT_PASS%" from the IOS_SIGNING_OPTIONS,
+ you'll be prompted to type it when packaging.
+ - IOS_PROVISION: path to the project's Provisioning Profile file
+
+ For example:
+
+ set IOS_DIST_CERT_FILE=cert\iphone_dev.p12
+ set IOS_DEV_CERT_FILE=cert\iphone_dev.p12
+ set IOS_DEV_CERT_PASS=YourPassword
+ set IOS_PROVISION=cert\YourFileName.mobileprovision
+
+
+6. Running/debugging the application on the device:
+
+ Note: if are testing your application for performance, always package for release (see step 7.)
+
+ 6.a. Build/Debug on device
+ - edit 'bat\RunApp.bat' and change the run target 'goto desktop' by 'goto ios-debug'
+ - build as usual (Ctrl+Enter or F5) to package
+ - you'll still have to manually upload & run the app on the device
+ - the application should connect to FlashDevelop interactive debugger as usual
+
+ 6.b. Debug occasionally on device
+ - Debug-build from FlashDevelop (F8)
+ - run 'bat\PackageApp.bat' to package and install a debug version of the application
+ - start FlashDevelop debugger: Debug > Start Remote Session
+ - start the application on device
+ - the application should connect to FlashDevelop interactive debugger as usual
+
+
+7. Packaging for release:
+
+ - edit 'bat\SetupApp.bat' to add the path to your "distribution" certificate (IOS_DIST_CERT_FILE)
+ Note: you can package ad-hoc IPAs using your developer certificate.
+
+ - Release-build from FlashDevelop (F8)
+ - run 'bat\PackageApp.bat' and select
+ either iOS/"ad-hoc" for installation on test devices
+ or iOS/App Store for upload in the iOS App Store.
+
+Tips:
+- iFunBox: iTunes replacement; installs app faster even if app version doesn't change,
+- TestFlightApp: ad-hoc distribution service http://testflightapp.com
+- HockeyKit: self hosted ad-hoc distribution https://github.com/TheRealKerni/HockeyKit
+- Manual ad-hoc distribution: http://samvermette.com/71
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/Project.as3proj
new file mode 100644
index 0000000000..c36ebd068d
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/Project.as3proj
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/Project.png
new file mode 100644
index 0000000000..bd84420d38
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/Project.txt
new file mode 100644
index 0000000000..5fa873d1c2
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/Project.txt
@@ -0,0 +1 @@
+An AIR mobile app written in ActionScript 3
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/application.xml.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/application.xml.template
new file mode 100644
index 0000000000..21d8a8f3ad
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/application.xml.template
@@ -0,0 +1,85 @@
+
+
+
+ air.$(PACKAGEDOT)$(PROJECTID)
+ 0.1
+ mobileDevice
+ $(PROJECTID)
+
+ $(PROJECTNAME)
+
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+ UIStatusBarStyle
+ UIStatusBarStyleBlackOpaque
+ UIRequiresPersistentWiFi
+ NO
+ UIPrerenderedIcon
+
+ UIApplicationExitsOnSuspend
+
+
+ UIDeviceFamily
+
+
+ 1
+
+
+
+
+ ]]>
+ high
+
+
+
+ $(PROJECTNAME)
+ $(PROJECTID).swf
+ true
+ true
+
+
+ direct
+
+
+
+
+ icons/icon_48.png
+ icons/icon_57.png
+ icons/icon_72.png
+ icons/icon_76.png
+ icons/icon_96.png
+ icons/icon_114.png
+ icons/icon_120.png
+ icons/icon_144.png
+ icons/icon_152.png
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/CreateCertificate.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/CreateCertificate.bat
new file mode 100644
index 0000000000..d2808914b9
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/CreateCertificate.bat
@@ -0,0 +1,34 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+:: Generate
+echo.
+echo Generating a self-signed certificate for Android packaging
+call adt -certificate -validityPeriod 25 -cn %AND_CERT_NAME% 2048-RSA "%AND_CERT_FILE%" %AND_CERT_PASS%
+if errorlevel 1 goto failed
+
+:succeed
+echo.
+echo Certificate created: %AND_CERT_FILE% with password "%AND_CERT_PASS%"
+echo.
+if "%AND_CERT_PASS%" == "fd" echo Note: you did not change the default password
+echo.
+echo HINTS:
+echo - you only need to generate this certificate once,
+echo - wait a minute before using this certificate to package your AIR application.
+echo.
+goto end
+
+:failed
+echo.
+echo Certificate creation FAILED.
+echo.
+
+:end
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/InstallAirRuntime.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/InstallAirRuntime.bat
new file mode 100644
index 0000000000..7e9e16f470
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/InstallAirRuntime.bat
@@ -0,0 +1,31 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+
+:: AIR runtime installer
+set AIR_INSTALLER=%FLEX_SDK%\runtimes\air\android\device\runtime.apk
+
+:: Install
+adb devices
+echo.
+echo Installing AIR runtime on current device:
+echo %AIR_INSTALLER%
+echo.
+adb install "%AIR_INSTALLER%"
+echo.
+if errorlevel 1 goto failed
+goto end
+
+:failed
+echo Troubleshooting:
+echo - one, and only one, Android device should be connected
+echo - verify 'bat\SetupSDK.bat'
+echo.
+goto end
+
+:end
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/PackageApp.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/PackageApp.bat
new file mode 100644
index 0000000000..e9dc50ecd1
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/PackageApp.bat
@@ -0,0 +1,87 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+:menu
+echo.
+echo Package for target
+echo.
+echo Android:
+echo.
+echo [1] normal (apk)
+echo [2] debug (apk-debug)
+echo [3] captive (apk-captive-runtime)
+echo.
+echo iOS:
+echo.
+echo [4] fast test (ipa-test-interpreter)
+echo [5] fast debug (ipa-debug-interpreter)
+echo [6] slow test (ipa-test)
+echo [7] slow debug (ipa-debug)
+echo [8] "ad-hoc" (ipa-ad-hoc)
+echo [9] App Store (ipa-app-store)
+echo.
+
+:choice
+set /P C=[Choice]:
+echo.
+
+set PLATFORM=android
+set OPTIONS=
+if %C% GTR 3 set PLATFORM=ios
+if %C% GTR 7 set PLATFORM=ios-dist
+
+if "%C%"=="1" set TARGET=
+if "%C%"=="2" set TARGET=-debug
+if "%C%"=="2" set OPTIONS=-connect %DEBUG_IP%
+if "%C%"=="3" set TARGET=-captive-runtime
+
+if "%C%"=="4" set TARGET=-test-interpreter
+if "%C%"=="5" set TARGET=-debug-interpreter
+if "%C%"=="5" set OPTIONS=-connect %DEBUG_IP%
+if "%C%"=="6" set TARGET=-test
+if "%C%"=="7" set TARGET=-debug
+if "%C%"=="7" set OPTIONS=-connect %DEBUG_IP%
+if "%C%"=="8" set TARGET=-ad-hoc
+if "%C%"=="9" set TARGET=-app-store
+
+call bat\Packager.bat
+
+if "%PLATFORM%"=="android" goto android-package
+
+:ios-package
+if "%AUTO_INSTALL_IOS%" == "yes" goto ios-install
+echo Now manually install and start application on device
+echo.
+goto end
+
+:ios-install
+echo Installing application for testing on iOS (%DEBUG_IP%)
+echo.
+call adt -installApp -platform ios -package "%OUTPUT%"
+if errorlevel 1 goto installfail
+
+echo Now manually start application on device
+echo.
+goto end
+
+:android-package
+adb devices
+echo.
+echo Installing %OUTPUT% on the device...
+echo.
+adb -d install -r "%OUTPUT%"
+if errorlevel 1 goto installfail
+goto end
+
+:installfail
+echo.
+echo Installing the app on the device failed
+
+:end
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/Packager.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/Packager.bat
new file mode 100644
index 0000000000..2c005b0034
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/Packager.bat
@@ -0,0 +1,76 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+if "%PLATFORM%"=="android" goto android-config
+if "%PLATFORM%"=="ios" goto ios-config
+if "%PLATFORM%"=="ios-dist" goto ios-dist-config
+goto start
+
+:android-config
+set CERT_FILE=%AND_CERT_FILE%
+set SIGNING_OPTIONS=%AND_SIGNING_OPTIONS%
+set ICONS=%AND_ICONS%
+set DIST_EXT=apk
+set TYPE=apk
+goto start
+
+:ios-config
+set CERT_FILE=%IOS_DEV_CERT_FILE%
+set SIGNING_OPTIONS=%IOS_DEV_SIGNING_OPTIONS%
+set ICONS=%IOS_ICONS%
+set DIST_EXT=ipa
+set TYPE=ipa
+goto start
+:: Set working dir
+cd %~dp0 & cd ..
+
+:ios-dist-config
+set CERT_FILE=%IOS_DIST_CERT_FILE%
+set SIGNING_OPTIONS=%IOS_DIST_SIGNING_OPTIONS%
+set ICONS=%IOS_ICONS%
+set DIST_EXT=ipa
+set TYPE=ipa
+goto start
+
+:start
+if not exist "%CERT_FILE%" goto certificate
+:: Output file
+set FILE_OR_DIR=%FILE_OR_DIR% -C "%ICONS%" .
+if not exist "%DIST_PATH%" md "%DIST_PATH%"
+set OUTPUT=%DIST_PATH%\%DIST_NAME%%TARGET%.%DIST_EXT%
+:: Package
+echo Packaging: %OUTPUT%
+echo using certificate: %CERT_FILE%...
+echo.
+call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS% "%OUTPUT%" "%APP_XML%" %FILE_OR_DIR%
+echo.
+if errorlevel 1 goto failed
+goto end
+
+:certificate
+echo Certificate not found: %CERT_FILE%
+echo.
+echo Android:
+echo - generate a default certificate using 'bat\CreateCertificate.bat'
+echo or configure a specific certificate in 'bat\SetupApp.bat'.
+echo.
+echo iOS:
+echo - configure your developer key and project's Provisioning Profile
+echo in 'bat\SetupApp.bat'.
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:failed
+echo APK setup creation FAILED.
+echo.
+echo Troubleshooting:
+echo - verify AIR SDK target version in %APP_XML%
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:end
+
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/RunApp.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/RunApp.bat
new file mode 100644
index 0000000000..9a06a2115e
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/RunApp.bat
@@ -0,0 +1,112 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+:target
+goto desktop
+::goto android-debug
+::goto android-test
+set INTERPRETER=-interpreter
+::goto ios-debug
+::goto ios-test
+
+:desktop
+:: http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-6fa6d7e0128cca93d31-8000.html
+
+set SCREEN_SIZE=NexusOne
+::set SCREEN_SIZE=iPhoneRetina
+
+:desktop-run
+echo.
+echo Starting AIR Debug Launcher with screen size '%SCREEN_SIZE%'
+echo.
+echo (hint: edit 'Run.bat' to test on device or change screen size)
+echo.
+adl -screensize %SCREEN_SIZE% "%APP_XML%" "%APP_DIR%"
+if errorlevel 1 goto end
+goto endNoPause
+
+:ios-debug
+echo.
+echo Packaging application for debugging on iOS %INTERPRETER%
+if "%INTERPRETER%" == "" echo (this will take a while)
+echo.
+set TARGET=-debug%INTERPRETER%
+set OPTIONS=-connect %DEBUG_IP%
+goto ios-package
+
+:ios-test
+echo.
+echo Packaging application for testing on iOS %INTERPRETER%
+if "%INTERPRETER%" == "" echo (this will take a while)
+echo.
+set TARGET=-test%INTERPRETER%
+set OPTIONS=
+goto ios-package
+
+:ios-package
+set PLATFORM=ios
+call bat\Packager.bat
+
+if "%AUTO_INSTALL_IOS%" == "yes" goto ios-install
+echo Now manually install and start application on device
+echo.
+goto end
+
+:ios-install
+echo Installing application for testing on iOS (%DEBUG_IP%)
+echo.
+call adt -installApp -platform ios -package "%OUTPUT%"
+if errorlevel 1 goto installfail
+
+echo Now manually start application on device
+echo.
+goto end
+
+:android-debug
+echo.
+echo Packaging and installing application for debugging on Android (%DEBUG_IP%)
+echo.
+set TARGET=-debug
+set OPTIONS=-connect %DEBUG_IP%
+goto android-package
+
+:android-test
+echo.
+echo Packaging and Installing application for testing on Android (%DEBUG_IP%)
+echo.
+set TARGET=
+set OPTIONS=
+goto android-package
+
+:android-package
+set PLATFORM=android
+call bat\Packager.bat
+
+adb devices
+echo.
+echo Installing %OUTPUT% on the device...
+echo.
+adb -d install -r "%OUTPUT%"
+if errorlevel 1 goto installfail
+
+echo.
+echo Starting application on the device for debugging...
+echo.
+adb shell am start -n air.%APP_ID%/.AppEntry
+exit
+
+:installfail
+echo.
+echo Installing the app on the device failed
+
+:end
+pause
+
+:endNoPause
+
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/SetupApp.bat.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/SetupApp.bat.template
new file mode 100644
index 0000000000..344a238091
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/SetupApp.bat.template
@@ -0,0 +1,59 @@
+:: Set working dir
+cd %~dp0 & cd ..
+
+:user_configuration
+
+:: About AIR application packaging
+:: http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7fd9.html
+
+:: NOTICE: all paths are relative to project root
+
+:: Android packaging
+set AND_CERT_NAME="$(PROJECTNAME)"
+set AND_CERT_PASS=fd
+set AND_CERT_FILE=cert\$(PROJECTID).p12
+set AND_ICONS=icons/android
+
+set AND_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%AND_CERT_FILE%" -storepass %AND_CERT_PASS%
+
+:: iOS packaging
+set IOS_DIST_CERT_FILE=
+set IOS_DEV_CERT_FILE=
+set IOS_DEV_CERT_PASS=
+set IOS_PROVISION=cert\$(PROJECTID).mobileprovision
+set IOS_ICONS=icons/ios
+
+set IOS_DEV_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%IOS_DEV_CERT_FILE%" -storepass %IOS_DEV_CERT_PASS% -provisioning-profile %IOS_PROVISION%
+set IOS_DIST_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%IOS_DIST_CERT_FILE%" -provisioning-profile %IOS_PROVISION%
+
+:: Application descriptor
+set APP_XML=application.xml
+
+:: Files to package
+set APP_DIR=bin
+set FILE_OR_DIR=-C %APP_DIR% .
+
+:: Your application ID (must match of Application descriptor) and remove spaces
+for /f "tokens=3 delims=<>" %%a in ('findstr /R /C:"^[ ]*" %APP_XML%') do set APP_ID=%%a
+set APP_ID=%APP_ID: =%
+
+:: Output packages
+set DIST_PATH=dist
+set DIST_NAME=$(PROJECTID)
+
+:: Debugging using a custom IP
+set DEBUG_IP=
+
+:validation
+findstr /C:"%APP_ID% " "%APP_XML%" > NUL
+if errorlevel 1 goto badid
+goto end
+
+:badid
+echo.
+echo ERROR:
+echo Application ID in 'bat\SetupApp.bat' (APP_ID)
+echo does NOT match Application descriptor '%APP_XML%' (id)
+echo.
+
+:end
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/SetupSDK.bat.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/SetupSDK.bat.template
new file mode 100644
index 0000000000..049596bcd5
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bat/SetupSDK.bat.template
@@ -0,0 +1,42 @@
+:: Set working dir
+cd %~dp0 & cd ..
+
+:user_configuration
+
+:: Static path to Flex SDK
+set FLEX_SDK=$(FlexSDK)
+
+:: Use FD supplied SDK path if executed from FD
+if exist "%FD_CUR_SDK%" set FLEX_SDK=%FD_CUR_SDK%
+
+set AUTO_INSTALL_IOS=yes
+
+:: Path to Android SDK
+set ANDROID_SDK="%FLEX_SDK%\lib\android\bin"
+
+:validation
+if not exist "%FLEX_SDK%\bin" goto flexsdk
+if not exist "%ANDROID_SDK%" goto androidsdk
+goto succeed
+
+:flexsdk
+echo.
+echo ERROR: incorrect path to Flex SDK in 'bat\SetupSDK.bat'
+echo.
+echo Looking for: %FLEX_SDK%\bin
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:androidsdk
+echo.
+echo ERROR: incorrect path to Android SDK in 'bat\SetupSDK.bat'
+echo.
+echo Looking for: %ANDROID_SDK%\platform-tools
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:succeed
+set PATH=%FLEX_SDK%\bin;%PATH%
+set PATH=%PATH%;%ANDROID_SDK%
diff --git a/FlashDevelop/Bin/Debug/Templates/ProjectFiles/AS3Project/Empty File.txt.fdt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bin/.empty
similarity index 100%
rename from FlashDevelop/Bin/Debug/Templates/ProjectFiles/AS3Project/Empty File.txt.fdt
rename to External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/bin/.empty
diff --git a/FlashDevelop/Bin/Debug/Templates/ProjectFiles/HaxeProject/Empty File.txt.fdt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/cert/.empty
similarity index 100%
rename from FlashDevelop/Bin/Debug/Templates/ProjectFiles/HaxeProject/Empty File.txt.fdt
rename to External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/cert/.empty
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_114.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_114.png
new file mode 100644
index 0000000000..5fa6290732
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_114.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_120.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_120.png
new file mode 100644
index 0000000000..89b32b51ee
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_120.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_144.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_144.png
new file mode 100644
index 0000000000..7a951f96ef
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_144.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_152.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_152.png
new file mode 100644
index 0000000000..5112cae675
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_152.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_192.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_192.png
new file mode 100644
index 0000000000..f4728d262d
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_192.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_48.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_48.png
new file mode 100644
index 0000000000..41fde440a2
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_48.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_57.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_57.png
new file mode 100644
index 0000000000..c1e5b2b97b
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_57.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_72.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_72.png
new file mode 100644
index 0000000000..3f884a977e
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_72.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_76.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_76.png
new file mode 100644
index 0000000000..5f5dc25b25
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_76.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_96.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_96.png
new file mode 100644
index 0000000000..4bac47c0a1
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/android/icons/icon_96.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default-568h@2x.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default-568h@2x.png
new file mode 100644
index 0000000000..a8c9bba5f5
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default-568h@2x.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default-Landscape.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default-Landscape.png
new file mode 100644
index 0000000000..5047b30cb0
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default-Landscape.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default-Portrait.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default-Portrait.png
new file mode 100644
index 0000000000..ec4faa2845
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default-Portrait.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default.png
new file mode 100644
index 0000000000..2b7b4be337
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default@2x.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default@2x.png
new file mode 100644
index 0000000000..45a5563bae
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/Default@2x.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_114.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_114.png
new file mode 100644
index 0000000000..5fa6290732
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_114.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_120.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_120.png
new file mode 100644
index 0000000000..89b32b51ee
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_120.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_144.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_144.png
new file mode 100644
index 0000000000..7a951f96ef
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_144.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_152.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_152.png
new file mode 100644
index 0000000000..5112cae675
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_152.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_192.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_192.png
new file mode 100644
index 0000000000..a177bd46d8
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_192.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_48.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_48.png
new file mode 100644
index 0000000000..41fde440a2
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_48.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_512.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_512.png
new file mode 100644
index 0000000000..5f9e4c7d53
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_512.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_57.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_57.png
new file mode 100644
index 0000000000..c1e5b2b97b
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_57.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_72.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_72.png
new file mode 100644
index 0000000000..3f884a977e
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_72.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_76.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_76.png
new file mode 100644
index 0000000000..5f5dc25b25
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_76.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_96.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_96.png
new file mode 100644
index 0000000000..4bac47c0a1
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/icons/ios/icons/icon_96.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/src/$(PackagePath)/Main.as.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/src/$(PackagePath)/Main.as.template
new file mode 100644
index 0000000000..69d1444a31
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/190 ActionScript 3 - AIR Mobile AS3 App/src/$(PackagePath)/Main.as.template
@@ -0,0 +1,35 @@
+package $(PackageName)$(CSLB){
+ import flash.desktop.NativeApplication;
+ import flash.events.Event;
+ import flash.display.Sprite;
+ import flash.display.StageAlign;
+ import flash.display.StageScaleMode;
+ import flash.ui.Multitouch;
+ import flash.ui.MultitouchInputMode;
+
+ /**
+ $(CBI)* ...
+ $(CBI)* @author $(DefaultUser)
+ $(CBI)*/
+ public class Main extends Sprite $(CSLB){
+
+ public function Main() $(CSLB){
+ stage.scaleMode = StageScaleMode.NO_SCALE;
+ stage.align = StageAlign.TOP_LEFT;
+ stage.addEventListener(Event.DEACTIVATE, deactivate);
+
+ // touch or gesture?
+ Multitouch.inputMode = MultitouchInputMode.TOUCH_POINT;
+
+ // Entry point
+ // New to AIR? Please read *carefully* the readme.txt files!
+ }
+
+ private function deactivate(e:Event):void $(CSLB){
+ // make sure the app behaves well (or exits) when in background
+ //NativeApplication.nativeApplication.exit();
+ }
+
+ }
+
+}
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/AIR_Android_readme.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/AIR_Android_readme.txt
new file mode 100644
index 0000000000..3a50c8cc03
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/AIR_Android_readme.txt
@@ -0,0 +1,48 @@
+AIR for Android instructions
+
+1. Configuration:
+
+ - edit 'bat\SetupSDK.bat' for paths to Flex SDK and Android SDK (defaults should be ok)
+
+ - install your device's USB drivers:
+ http://developer.android.com/sdk/oem-usb.html
+ - enable "USB debugging" on your Android device:
+ Parameters > Applications > Development > USB Debugging
+
+
+2. Creating a self-signed certificate:
+
+ - run 'bat\CreateCertificate.bat' to generate your self-signed certificate,
+
+ (!) wait a minute before packaging.
+
+
+3. Build from FlashDevelop as usual (F8)
+
+
+4. Run/debug the application on the desktop as usual (F5 or Ctrl+Enter)
+
+
+5. Install AIR runtime on your device:
+
+ - run 'bat\InstallAirRuntime.bat'
+
+
+6. Running/debugging the application on the device:
+
+ 6.a. Build/Debug directly on device
+ - edit 'bat\RunApp.bat' and change the run target 'goto desktop' by 'goto android-debug'
+ - build & run as usual (Ctrl+Enter or F5) to package, install & run the application on your device
+
+ 6.b. Debug occasionally on device
+ - Debug-build from FlashDevelop (F8)
+ - run 'bat\PackageApp.bat' to package and install a debug version of the application
+ - start FlashDevelop debugger: Debug > Start Remote Session
+ - start the application on device
+ - the application should connect to FlashDevelop interactive debugger as usual
+
+
+7. Packaging for release:
+
+ - Release-build from FlashDevelop (F8)
+ - run 'bat\PackageApp.bat' and select Android/normal target
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/AIR_iOS_readme.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/AIR_iOS_readme.txt
new file mode 100644
index 0000000000..2749617db4
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/AIR_iOS_readme.txt
@@ -0,0 +1,82 @@
+AIR for iOS instructions
+
+1. Configuration:
+
+ - edit 'bat\SetupSDK.bat' for path to Flex SDK (defaults should be ok)
+
+
+3. Build from FlashDevelop as usual (F8)
+
+
+4. Run/debug the application on the desktop as usual (F5 or Ctrl+Enter)
+
+
+5. Configure for iOS packaging in 'bat\SetupApp.bat':
+
+ Take a deep breath, pay the Apple tax and read extra carefully this tutorial:
+ - http://www.codeandvisual.com/2011/exporting-for-iphone-using-air-27-and-flashdevelop-part-three-generating-developer-certificates-provisioning-profiles-and-p12-files/
+
+ Now this is how to create the p12 key entirely on Windows:
+ - http://blog.nngafook.com/2012/06/ios-certificate-process/
+
+ And later to sign the application for the App Store publication:
+ - http://blog.nngafook.com/2013/03/packaging-and-submitting-your-app-to-apple-on-windows-kind-of/
+
+ Then for each project you'll have to go to on Apple's iOS Provisioning Portal:
+ - create a new App ID with: name of the project and ID indicated in 'application.xml',
+ - create a new Provisioning Profile: select App ID & registered devices that will be allowed to install the app.
+
+ Once you have obtained a .p12 and .mobileprovision file from Apple's Provisioning Portal:
+ - save a copy of your .p12 and .mobileprovision certificates in the 'cert\' folder in your FlashDevelop project.
+ (make sure to keep an extra copy of these 2 files in a safe place)
+
+ Finally edit 'bat\SetupApp.bat' and complete the following lines:
+
+ - IOS_DEV_CERT_FILE: path to your iOS developer 'p12' key ('cert\' folder, if you have followed the instructions above)
+ - IOS_DEV_CERT_PASS: developer certificate's password
+ if you don't set it, remove "-storepass %IOS_DEV_CERT_PASS%" from the IOS_SIGNING_OPTIONS,
+ you'll be prompted to type it when packaging.
+ - IOS_PROVISION: path to the project's Provisioning Profile file
+
+ For example:
+
+ set IOS_DIST_CERT_FILE=cert\iphone_dev.p12
+ set IOS_DEV_CERT_FILE=cert\iphone_dev.p12
+ set IOS_DEV_CERT_PASS=YourPassword
+ set IOS_PROVISION=cert\YourFileName.mobileprovision
+
+
+6. Running/debugging the application on the device:
+
+ Note: if are testing your application for performance, always package for release (see step 7.)
+
+ 6.a. Build/Debug on device
+ - edit 'bat\RunApp.bat' and change the run target 'goto desktop' by 'goto ios-debug'
+ - build as usual (Ctrl+Enter or F5) to package
+ - you'll still have to manually upload & run the app on the device
+ - the application should connect to FlashDevelop interactive debugger as usual
+
+ 6.b. Debug occasionally on device
+ - Debug-build from FlashDevelop (F8)
+ - run 'bat\PackageApp.bat' to package and install a debug version of the application
+ - start FlashDevelop debugger: Debug > Start Remote Session
+ - start the application on device
+ - the application should connect to FlashDevelop interactive debugger as usual
+
+
+7. Packaging for release:
+
+ - edit in 'bat\SetupApp.bat' to add your "distribution" certificate (IOS_DIST_CERT_FILE)
+ Note: you can package ad-hoc IPAs using your developer certificate.
+
+ - Release-build from FlashDevelop (F8)
+ - run 'bat\PackageApp.bat' and select
+ either iOS/"ad-hoc" for installation on test devices
+ or iOS/App Store for upload in the iOS App Store.
+
+Tips:
+- iFunBox: iTunes replacement; installs app faster even if app version doesn't change,
+- TestFlightApp: ad-hoc distribution service http://testflightapp.com
+- HockeyKit: self hosted ad-hoc distribution https://github.com/TheRealKerni/HockeyKit
+- Manual ad-hoc distribution: http://samvermette.com/71
+
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/Project.as3proj
new file mode 100644
index 0000000000..28261c4442
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/Project.as3proj
@@ -0,0 +1,82 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/Project.png
new file mode 100644
index 0000000000..bd84420d38
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/Project.txt
new file mode 100644
index 0000000000..c582302989
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/Project.txt
@@ -0,0 +1 @@
+An AIR mobile app written in ActionScript 3 using the Flex framework
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/application.xml.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/application.xml.template
new file mode 100644
index 0000000000..21a8986457
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/application.xml.template
@@ -0,0 +1,84 @@
+
+
+
+ air.$(PACKAGEDOT)$(PROJECTID)
+ 0.1
+ mobileDevice
+ $(PROJECTID)
+
+ $(PROJECTNAME)
+
+
+
+
+
+
+
+
+
+
+ ]]>
+
+
+ UIStatusBarStyle
+ UIStatusBarStyleBlackOpaque
+ UIRequiresPersistentWiFi
+ NO
+ UIPrerenderedIcon
+
+ UIApplicationExitsOnSuspend
+
+
+ UIDeviceFamily
+
+
+ 1
+
+
+
+
+ ]]>
+ high
+
+
+
+ $(PROJECTNAME)
+ $(PROJECTID).swf
+ true
+ true
+
+
+ direct
+
+
+
+ icons/icon_48.png
+ icons/icon_57.png
+ icons/icon_72.png
+ icons/icon_76.png
+ icons/icon_96.png
+ icons/icon_114.png
+ icons/icon_120.png
+ icons/icon_144.png
+ icons/icon_152.png
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/CreateCertificate.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/CreateCertificate.bat
new file mode 100644
index 0000000000..3b3f27e3b0
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/CreateCertificate.bat
@@ -0,0 +1,34 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+:: Generate
+echo.
+echo Generating a self-signed certificate for Android packaging
+call adt -certificate -validityPeriod 25 -cn %AND_CERT_NAME% 2048-RSA "%AND_CERT_FILE%" %AND_CERT_PASS%
+if errorlevel 1 goto failed
+
+:succeed
+echo.
+echo Certificate created: %AND_CERT_FILE% with password "%AND_CERT_PASS%"
+echo.
+if "%AND_CERT_PASS%" == "fd" echo Note: You did not change the default password
+echo.
+echo HINTS:
+echo - you only need to generate this certificate once,
+echo - wait a minute before using this certificate to package your AIR application.
+echo.
+goto end
+
+:failed
+echo.
+echo Certificate creation FAILED.
+echo.
+
+:end
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/InstallAirRuntime.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/InstallAirRuntime.bat
new file mode 100644
index 0000000000..7e9e16f470
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/InstallAirRuntime.bat
@@ -0,0 +1,31 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+
+:: AIR runtime installer
+set AIR_INSTALLER=%FLEX_SDK%\runtimes\air\android\device\runtime.apk
+
+:: Install
+adb devices
+echo.
+echo Installing AIR runtime on current device:
+echo %AIR_INSTALLER%
+echo.
+adb install "%AIR_INSTALLER%"
+echo.
+if errorlevel 1 goto failed
+goto end
+
+:failed
+echo Troubleshooting:
+echo - one, and only one, Android device should be connected
+echo - verify 'bat\SetupSDK.bat'
+echo.
+goto end
+
+:end
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/PackageApp.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/PackageApp.bat
new file mode 100644
index 0000000000..e9dc50ecd1
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/PackageApp.bat
@@ -0,0 +1,87 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+:menu
+echo.
+echo Package for target
+echo.
+echo Android:
+echo.
+echo [1] normal (apk)
+echo [2] debug (apk-debug)
+echo [3] captive (apk-captive-runtime)
+echo.
+echo iOS:
+echo.
+echo [4] fast test (ipa-test-interpreter)
+echo [5] fast debug (ipa-debug-interpreter)
+echo [6] slow test (ipa-test)
+echo [7] slow debug (ipa-debug)
+echo [8] "ad-hoc" (ipa-ad-hoc)
+echo [9] App Store (ipa-app-store)
+echo.
+
+:choice
+set /P C=[Choice]:
+echo.
+
+set PLATFORM=android
+set OPTIONS=
+if %C% GTR 3 set PLATFORM=ios
+if %C% GTR 7 set PLATFORM=ios-dist
+
+if "%C%"=="1" set TARGET=
+if "%C%"=="2" set TARGET=-debug
+if "%C%"=="2" set OPTIONS=-connect %DEBUG_IP%
+if "%C%"=="3" set TARGET=-captive-runtime
+
+if "%C%"=="4" set TARGET=-test-interpreter
+if "%C%"=="5" set TARGET=-debug-interpreter
+if "%C%"=="5" set OPTIONS=-connect %DEBUG_IP%
+if "%C%"=="6" set TARGET=-test
+if "%C%"=="7" set TARGET=-debug
+if "%C%"=="7" set OPTIONS=-connect %DEBUG_IP%
+if "%C%"=="8" set TARGET=-ad-hoc
+if "%C%"=="9" set TARGET=-app-store
+
+call bat\Packager.bat
+
+if "%PLATFORM%"=="android" goto android-package
+
+:ios-package
+if "%AUTO_INSTALL_IOS%" == "yes" goto ios-install
+echo Now manually install and start application on device
+echo.
+goto end
+
+:ios-install
+echo Installing application for testing on iOS (%DEBUG_IP%)
+echo.
+call adt -installApp -platform ios -package "%OUTPUT%"
+if errorlevel 1 goto installfail
+
+echo Now manually start application on device
+echo.
+goto end
+
+:android-package
+adb devices
+echo.
+echo Installing %OUTPUT% on the device...
+echo.
+adb -d install -r "%OUTPUT%"
+if errorlevel 1 goto installfail
+goto end
+
+:installfail
+echo.
+echo Installing the app on the device failed
+
+:end
+pause
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/Packager.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/Packager.bat
new file mode 100644
index 0000000000..6b96b0cc84
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/Packager.bat
@@ -0,0 +1,75 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+if "%PLATFORM%"=="android" goto android-config
+if "%PLATFORM%"=="ios" goto ios-config
+if "%PLATFORM%"=="ios-dist" goto ios-dist-config
+goto start
+
+:android-config
+set CERT_FILE=%AND_CERT_FILE%
+set SIGNING_OPTIONS=%AND_SIGNING_OPTIONS%
+set ICONS=%AND_ICONS%
+set DIST_EXT=apk
+set TYPE=apk
+goto start
+
+:ios-config
+set CERT_FILE=%IOS_DEV_CERT_FILE%
+set SIGNING_OPTIONS=%IOS_DEV_SIGNING_OPTIONS%
+set ICONS=%IOS_ICONS%
+set DIST_EXT=ipa
+set TYPE=ipa
+goto start
+:: Set working dir
+cd %~dp0 & cd ..
+
+:ios-dist-config
+set CERT_FILE=%IOS_DIST_CERT_FILE%
+set SIGNING_OPTIONS=%IOS_DIST_SIGNING_OPTIONS%
+set ICONS=%IOS_ICONS%
+set DIST_EXT=ipa
+set TYPE=ipa
+goto start
+
+:start
+if not exist "%CERT_FILE%" goto certificate
+:: Output file
+set FILE_OR_DIR=%FILE_OR_DIR% -C "%ICONS%" .
+if not exist "%DIST_PATH%" md "%DIST_PATH%"
+set OUTPUT=%DIST_PATH%\%DIST_NAME%%TARGET%.%DIST_EXT%
+:: Package
+echo Packaging: %OUTPUT%
+echo using certificate: %CERT_FILE%...
+echo.
+call adt -package -target %TYPE%%TARGET% %OPTIONS% %SIGNING_OPTIONS% "%OUTPUT%" "%APP_XML%" %FILE_OR_DIR%
+echo.
+if errorlevel 1 goto failed
+goto end
+
+:certificate
+echo Certificate not found: %CERT_FILE%
+echo.
+echo Android:
+echo - generate a default certificate using 'bat\CreateCertificate.bat'
+echo or configure a specific certificate in 'bat\SetupApp.bat'.
+echo.
+echo iOS:
+echo - configure your developer key and project's Provisioning Profile
+echo in 'bat\SetupApp.bat'.
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:failed
+echo APK setup creation FAILED.
+echo.
+echo Troubleshooting:
+echo - verify AIR SDK target version in %APP_XML%
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:end
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/RunApp.bat b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/RunApp.bat
new file mode 100644
index 0000000000..c621e41e79
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/RunApp.bat
@@ -0,0 +1,112 @@
+@echo off
+
+:: Set working dir
+cd %~dp0 & cd ..
+
+set PAUSE_ERRORS=1
+call bat\SetupSDK.bat
+call bat\SetupApp.bat
+
+:target
+goto desktop
+::goto android-debug
+::goto android-test
+set INTERPRETER=-interpreter
+::goto ios-debug
+::goto ios-test
+
+:desktop
+:: http://help.adobe.com/en_US/air/build/WSfffb011ac560372f-6fa6d7e0128cca93d31-8000.html
+
+set SCREEN_SIZE=NexusOne
+::set SCREEN_SIZE=iPhoneRetina
+
+:desktop-run
+echo.
+echo Starting AIR Debug Launcher with screen size '%SCREEN_SIZE%'
+echo.
+echo (hint: edit 'bat\RunApp.bat' to test on device or change screen size)
+echo.
+adl -screensize %SCREEN_SIZE% "%APP_XML%" "%APP_DIR%"
+if errorlevel 1 goto end
+goto endNoPause
+
+:ios-debug
+echo.
+echo Packaging application for debugging on iOS %INTERPRETER%
+if "%INTERPRETER%" == "" echo (this will take a while)
+echo.
+set TARGET=-debug%INTERPRETER%
+set OPTIONS=-connect %DEBUG_IP%
+goto ios-package
+
+:ios-test
+echo.
+echo Packaging application for testing on iOS %INTERPRETER%
+if "%INTERPRETER%" == "" echo (this will take a while)
+echo.
+set TARGET=-test%INTERPRETER%
+set OPTIONS=
+goto ios-package
+
+:ios-package
+set PLATFORM=ios
+call bat\Packager.bat
+
+if "%AUTO_INSTALL_IOS%" == "yes" goto ios-install
+echo Now manually install and start application on device
+echo.
+goto end
+
+:ios-install
+echo Installing application for testing on iOS (%DEBUG_IP%)
+echo.
+call adt -installApp -platform ios -package "%OUTPUT%"
+if errorlevel 1 goto installfail
+
+echo Now manually start application on device
+echo.
+goto end
+
+:android-debug
+echo.
+echo Packaging and installing application for debugging on Android (%DEBUG_IP%)
+echo.
+set TARGET=-debug
+set OPTIONS=-connect %DEBUG_IP%
+goto android-package
+
+:android-test
+echo.
+echo Packaging and Installing application for testing on Android (%DEBUG_IP%)
+echo.
+set TARGET=
+set OPTIONS=
+goto android-package
+
+:android-package
+set PLATFORM=android
+call bat\Packager.bat
+
+adb devices
+echo.
+echo Installing %OUTPUT% on the device...
+echo.
+adb -d install -r "%OUTPUT%"
+if errorlevel 1 goto installfail
+
+echo.
+echo Starting application on the device for debugging...
+echo.
+adb shell am start -n air.%APP_ID%/.AppEntry
+exit
+
+:installfail
+echo.
+echo Installing the app on the device failed
+
+:end
+pause
+
+:endNoPause
+
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/SetupApp.bat.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/SetupApp.bat.template
new file mode 100644
index 0000000000..344a238091
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/SetupApp.bat.template
@@ -0,0 +1,59 @@
+:: Set working dir
+cd %~dp0 & cd ..
+
+:user_configuration
+
+:: About AIR application packaging
+:: http://help.adobe.com/en_US/air/build/WS5b3ccc516d4fbf351e63e3d118666ade46-7fd9.html
+
+:: NOTICE: all paths are relative to project root
+
+:: Android packaging
+set AND_CERT_NAME="$(PROJECTNAME)"
+set AND_CERT_PASS=fd
+set AND_CERT_FILE=cert\$(PROJECTID).p12
+set AND_ICONS=icons/android
+
+set AND_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%AND_CERT_FILE%" -storepass %AND_CERT_PASS%
+
+:: iOS packaging
+set IOS_DIST_CERT_FILE=
+set IOS_DEV_CERT_FILE=
+set IOS_DEV_CERT_PASS=
+set IOS_PROVISION=cert\$(PROJECTID).mobileprovision
+set IOS_ICONS=icons/ios
+
+set IOS_DEV_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%IOS_DEV_CERT_FILE%" -storepass %IOS_DEV_CERT_PASS% -provisioning-profile %IOS_PROVISION%
+set IOS_DIST_SIGNING_OPTIONS=-storetype pkcs12 -keystore "%IOS_DIST_CERT_FILE%" -provisioning-profile %IOS_PROVISION%
+
+:: Application descriptor
+set APP_XML=application.xml
+
+:: Files to package
+set APP_DIR=bin
+set FILE_OR_DIR=-C %APP_DIR% .
+
+:: Your application ID (must match of Application descriptor) and remove spaces
+for /f "tokens=3 delims=<>" %%a in ('findstr /R /C:"^[ ]*" %APP_XML%') do set APP_ID=%%a
+set APP_ID=%APP_ID: =%
+
+:: Output packages
+set DIST_PATH=dist
+set DIST_NAME=$(PROJECTID)
+
+:: Debugging using a custom IP
+set DEBUG_IP=
+
+:validation
+findstr /C:"%APP_ID% " "%APP_XML%" > NUL
+if errorlevel 1 goto badid
+goto end
+
+:badid
+echo.
+echo ERROR:
+echo Application ID in 'bat\SetupApp.bat' (APP_ID)
+echo does NOT match Application descriptor '%APP_XML%' (id)
+echo.
+
+:end
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/SetupSDK.bat.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/SetupSDK.bat.template
new file mode 100644
index 0000000000..5e305dcfeb
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bat/SetupSDK.bat.template
@@ -0,0 +1,42 @@
+:: Set working dir
+cd %~dp0 & cd ..
+
+:user_configuration
+
+:: Static path to Flex SDK
+set FLEX_SDK=$(FlexSDK)
+
+:: Use FD supplied SDK path if executed from FD
+if exist "%FD_CUR_SDK%" set FLEX_SDK=%FD_CUR_SDK%
+
+set AUTO_INSTALL_IOS=yes
+
+:: Path to Android SDK
+set ANDROID_SDK=$(AppDir)\Tools\android
+
+:validation
+if not exist "%FLEX_SDK%\bin" goto flexsdk
+if not exist "%ANDROID_SDK%\platform-tools" goto androidsdk
+goto succeed
+
+:flexsdk
+echo.
+echo ERROR: incorrect path to Flex SDK in 'bat\SetupSDK.bat'
+echo.
+echo Looking for: %FLEX_SDK%\bin
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:androidsdk
+echo.
+echo ERROR: incorrect path to Android SDK in 'bat\SetupSDK.bat'
+echo.
+echo Looking for: %ANDROID_SDK%\platform-tools
+echo.
+if %PAUSE_ERRORS%==1 pause
+exit
+
+:succeed
+set PATH=%FLEX_SDK%\bin;%PATH%
+set PATH=%PATH%;%ANDROID_SDK%\platform-tools
diff --git a/FlashDevelop/Bin/Debug/Templates/ProjectFiles/LoomProject/Empty File.txt.fdt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bin/.empty
similarity index 100%
rename from FlashDevelop/Bin/Debug/Templates/ProjectFiles/LoomProject/Empty File.txt.fdt
rename to External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/bin/.empty
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/cert/.empty b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/cert/.empty
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_114.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_114.png
new file mode 100644
index 0000000000..5fa6290732
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_114.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_120.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_120.png
new file mode 100644
index 0000000000..89b32b51ee
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_120.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_144.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_144.png
new file mode 100644
index 0000000000..7a951f96ef
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_144.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_152.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_152.png
new file mode 100644
index 0000000000..5112cae675
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_152.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_192.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_192.png
new file mode 100644
index 0000000000..f4728d262d
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_192.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_48.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_48.png
new file mode 100644
index 0000000000..41fde440a2
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_48.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_57.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_57.png
new file mode 100644
index 0000000000..c1e5b2b97b
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_57.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_72.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_72.png
new file mode 100644
index 0000000000..3f884a977e
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_72.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_76.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_76.png
new file mode 100644
index 0000000000..5f5dc25b25
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_76.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_96.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_96.png
new file mode 100644
index 0000000000..4bac47c0a1
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/android/icons/icon_96.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default-568h@2x.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default-568h@2x.png
new file mode 100644
index 0000000000..a8c9bba5f5
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default-568h@2x.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default-Landscape.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default-Landscape.png
new file mode 100644
index 0000000000..5047b30cb0
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default-Landscape.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default-Portrait.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default-Portrait.png
new file mode 100644
index 0000000000..ec4faa2845
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default-Portrait.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default.png
new file mode 100644
index 0000000000..2b7b4be337
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default@2x.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default@2x.png
new file mode 100644
index 0000000000..45a5563bae
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/Default@2x.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_114.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_114.png
new file mode 100644
index 0000000000..5fa6290732
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_114.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_120.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_120.png
new file mode 100644
index 0000000000..89b32b51ee
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_120.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_144.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_144.png
new file mode 100644
index 0000000000..7a951f96ef
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_144.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_152.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_152.png
new file mode 100644
index 0000000000..5112cae675
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_152.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_192.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_192.png
new file mode 100644
index 0000000000..a177bd46d8
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_192.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_48.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_48.png
new file mode 100644
index 0000000000..41fde440a2
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_48.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_512.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_512.png
new file mode 100644
index 0000000000..5f9e4c7d53
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_512.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_57.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_57.png
new file mode 100644
index 0000000000..c1e5b2b97b
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_57.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_72.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_72.png
new file mode 100644
index 0000000000..3f884a977e
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_72.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_76.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_76.png
new file mode 100644
index 0000000000..5f5dc25b25
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_76.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_96.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_96.png
new file mode 100644
index 0000000000..4bac47c0a1
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/icons/ios/icons/icon_96.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/src/$(PackagePath)/Main.mxml.template b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/src/$(PackagePath)/Main.mxml.template
new file mode 100644
index 0000000000..cc93a3a8cf
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/src/$(PackagePath)/Main.mxml.template
@@ -0,0 +1,12 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/src/$(PackagePath)/views/HomeView.mxml b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/src/$(PackagePath)/views/HomeView.mxml
new file mode 100644
index 0000000000..977d37fe72
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/195 ActionScript 3 - AIR Mobile Flex App/src/$(PackagePath)/views/HomeView.mxml
@@ -0,0 +1,10 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/200 ActionScript 3 - Empty Project/Project.as3proj b/External/Extensions/AS3Templates/$(BaseDir)/Projects/200 ActionScript 3 - Empty Project/Project.as3proj
new file mode 100644
index 0000000000..1392f127d4
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/200 ActionScript 3 - Empty Project/Project.as3proj
@@ -0,0 +1,57 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/200 ActionScript 3 - Empty Project/Project.png b/External/Extensions/AS3Templates/$(BaseDir)/Projects/200 ActionScript 3 - Empty Project/Project.png
new file mode 100644
index 0000000000..3e703a61be
Binary files /dev/null and b/External/Extensions/AS3Templates/$(BaseDir)/Projects/200 ActionScript 3 - Empty Project/Project.png differ
diff --git a/External/Extensions/AS3Templates/$(BaseDir)/Projects/200 ActionScript 3 - Empty Project/Project.txt b/External/Extensions/AS3Templates/$(BaseDir)/Projects/200 ActionScript 3 - Empty Project/Project.txt
new file mode 100644
index 0000000000..12611f0d22
--- /dev/null
+++ b/External/Extensions/AS3Templates/$(BaseDir)/Projects/200 ActionScript 3 - Empty Project/Project.txt
@@ -0,0 +1 @@
+An empty project written in ActionScript 3 for Flash 9+ Player
\ No newline at end of file
diff --git a/External/Extensions/AS3Templates/AS3Templates-1.00.fdz b/External/Extensions/AS3Templates/AS3Templates-1.00.fdz
new file mode 100644
index 0000000000..db5ba08a44
Binary files /dev/null and b/External/Extensions/AS3Templates/AS3Templates-1.00.fdz differ
diff --git a/External/Extensions/AzothExtension/$(AppDir)/Tools/azoth/azoth.exe b/External/Extensions/AzothExtension/$(AppDir)/Tools/azoth/azoth.exe
old mode 100644
new mode 100755
diff --git a/External/Extensions/LoomExtension/$(BaseDir)/Plugins/LoomContext.dll b/External/Extensions/LoomExtension/$(BaseDir)/Plugins/LoomContext.dll
new file mode 100755
index 0000000000..47ef4a592d
Binary files /dev/null and b/External/Extensions/LoomExtension/$(BaseDir)/Plugins/LoomContext.dll differ
diff --git a/FlashDevelop/Bin/Debug/Projects/520 Other - Loom App/Project.lsproj b/External/Extensions/LoomExtension/$(BaseDir)/Projects/520 Other - Loom App/Project.lsproj
similarity index 100%
rename from FlashDevelop/Bin/Debug/Projects/520 Other - Loom App/Project.lsproj
rename to External/Extensions/LoomExtension/$(BaseDir)/Projects/520 Other - Loom App/Project.lsproj
diff --git a/External/Extensions/LoomExtension/$(BaseDir)/Projects/520 Other - Loom App/Project.png b/External/Extensions/LoomExtension/$(BaseDir)/Projects/520 Other - Loom App/Project.png
new file mode 100644
index 0000000000..059f16b8fa
Binary files /dev/null and b/External/Extensions/LoomExtension/$(BaseDir)/Projects/520 Other - Loom App/Project.png differ
diff --git a/FlashDevelop/Bin/Debug/Projects/520 Other - Loom App/Project.txt b/External/Extensions/LoomExtension/$(BaseDir)/Projects/520 Other - Loom App/Project.txt
similarity index 100%
rename from FlashDevelop/Bin/Debug/Projects/520 Other - Loom App/Project.txt
rename to External/Extensions/LoomExtension/$(BaseDir)/Projects/520 Other - Loom App/Project.txt
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/boundaries/AccessorsMethods.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/boundaries/AccessorsMethods.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/boundaries/AccessorsMethods.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/boundaries/AccessorsMethods.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/boundaries/EventHandlers.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/boundaries/EventHandlers.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/boundaries/EventHandlers.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/boundaries/EventHandlers.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/boundaries/PrivateMethods.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/boundaries/PrivateMethods.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/boundaries/PrivateMethods.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/boundaries/PrivateMethods.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/boundaries/PublicMethods.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/boundaries/PublicMethods.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/boundaries/PublicMethods.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/boundaries/PublicMethods.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/boundaries/StaticMethods.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/boundaries/StaticMethods.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/boundaries/StaticMethods.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/boundaries/StaticMethods.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/case.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/case.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/case.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/case.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/catch.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/catch.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/catch.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/catch.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/class.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/class.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/class.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/class.fds
diff --git a/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/do.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/do.fds
new file mode 100644
index 0000000000..12a226cb19
--- /dev/null
+++ b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/do.fds
@@ -0,0 +1,3 @@
+do $(CSLB){
+
+} while ($(EntryPoint));
\ No newline at end of file
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/each.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/each.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/each.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/each.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/else.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/else.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/else.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/else.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/elseif.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/elseif.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/elseif.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/elseif.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/finally.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/finally.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/finally.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/finally.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/for.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/for.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/for.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/for.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/foreach.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/foreach.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/foreach.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/foreach.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/forin.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/forin.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/forin.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/forin.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/function.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/function.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/function.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/function.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/AssignVariable.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/AssignVariable.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/AssignVariable.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/AssignVariable.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/CallFunction.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/CallFunction.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/CallFunction.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/CallFunction.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/Constant.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Constant.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/Constant.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Constant.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/Constructor.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Constructor.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/Constructor.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Constructor.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/Delegate.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Delegate.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/Delegate.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Delegate.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/DelegateMethodsHeader.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/DelegateMethodsHeader.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/DelegateMethodsHeader.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/DelegateMethodsHeader.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/EventHandler.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/EventHandler.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/EventHandler.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/EventHandler.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/EventMetatag.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/EventMetatag.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/EventMetatag.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/EventMetatag.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/FieldFromParameter.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/FieldFromParameter.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/FieldFromParameter.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/FieldFromParameter.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/Function.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Function.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/Function.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Function.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/FunctionParameter.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/FunctionParameter.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/FunctionParameter.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/FunctionParameter.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/Getter.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Getter.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/Getter.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Getter.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/IFunction.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/IFunction.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/IFunction.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/IFunction.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/IGetter.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/IGetter.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/IGetter.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/IGetter.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/ISetter.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/ISetter.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/ISetter.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/ISetter.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/ImplementHeader.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/ImplementHeader.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/ImplementHeader.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/ImplementHeader.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/MethodDeclaration.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/MethodDeclaration.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/MethodDeclaration.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/MethodDeclaration.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/MethodOverride.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/MethodOverride.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/MethodOverride.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/MethodOverride.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/Setter.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Setter.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/Setter.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Setter.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/ToString.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/ToString.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/ToString.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/ToString.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/generators/Variable.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Variable.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/generators/Variable.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/generators/Variable.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/get.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/get.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/get.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/get.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/if.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/if.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/if.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/if.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/region.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/region.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/region.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/region.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/set.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/set.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/set.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/set.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/surround/().fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/().fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/surround/().fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/().fds
diff --git a/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/do..while.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/do..while.fds
new file mode 100644
index 0000000000..d63b442bc3
--- /dev/null
+++ b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/do..while.fds
@@ -0,0 +1,3 @@
+do $(CSLB){
+ {0}
+} while ($(EntryPoint));
\ No newline at end of file
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/surround/for..each.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/for..each.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/surround/for..each.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/for..each.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/surround/for..in.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/for..in.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/surround/for..in.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/for..in.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/surround/for.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/for.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/surround/for.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/for.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/surround/if.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/if.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/surround/if.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/if.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/surround/try..catch.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/try..catch.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/surround/try..catch.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/try..catch.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/surround/while.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/while.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/surround/while.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/surround/while.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/switch.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/switch.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/switch.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/switch.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/try.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/try.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/try.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/try.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/while.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/while.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/while.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/while.fds
diff --git a/FlashDevelop/Bin/Debug/Snippets/loom/with.fds b/External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/with.fds
similarity index 100%
rename from FlashDevelop/Bin/Debug/Snippets/loom/with.fds
rename to External/Extensions/LoomExtension/$(BaseDir)/Snippets/loom/with.fds
diff --git a/FlashDevelop/Bin/Debug/Templates/ProjectFiles/LoomProject/Class.ls.fdt b/External/Extensions/LoomExtension/$(BaseDir)/Templates/ProjectFiles/LoomProject/Class.ls.fdt
similarity index 100%
rename from FlashDevelop/Bin/Debug/Templates/ProjectFiles/LoomProject/Class.ls.fdt
rename to External/Extensions/LoomExtension/$(BaseDir)/Templates/ProjectFiles/LoomProject/Class.ls.fdt
diff --git a/FlashDevelop/Bin/Debug/Templates/ProjectFiles/LoomProject/Class.ls.fdt.wizard b/External/Extensions/LoomExtension/$(BaseDir)/Templates/ProjectFiles/LoomProject/Class.ls.fdt.wizard
similarity index 100%
rename from FlashDevelop/Bin/Debug/Templates/ProjectFiles/LoomProject/Class.ls.fdt.wizard
rename to External/Extensions/LoomExtension/$(BaseDir)/Templates/ProjectFiles/LoomProject/Class.ls.fdt.wizard
diff --git a/FlashDevelop/Bin/Debug/Templates/ProjectFiles/LoomProject/Interface.ls.fdt b/External/Extensions/LoomExtension/$(BaseDir)/Templates/ProjectFiles/LoomProject/Interface.ls.fdt
similarity index 100%
rename from FlashDevelop/Bin/Debug/Templates/ProjectFiles/LoomProject/Interface.ls.fdt
rename to External/Extensions/LoomExtension/$(BaseDir)/Templates/ProjectFiles/LoomProject/Interface.ls.fdt
diff --git a/External/Extensions/LoomExtension/LoomContext-1.00.fdz b/External/Extensions/LoomExtension/LoomContext-1.00.fdz
new file mode 100644
index 0000000000..049727aea8
Binary files /dev/null and b/External/Extensions/LoomExtension/LoomContext-1.00.fdz differ
diff --git a/External/Extensions/Unity3DExtension/$(BaseDir)/Plugins/UnityContext.dll b/External/Extensions/Unity3DExtension/$(BaseDir)/Plugins/UnityContext.dll
old mode 100644
new mode 100755
diff --git a/External/Graphics/FONTS.txt b/External/Graphics/FONTS.txt
new file mode 100644
index 0000000000..59f0ebb334
--- /dev/null
+++ b/External/Graphics/FONTS.txt
@@ -0,0 +1,2 @@
+Helvetica-Bold
+BreuerText-Bold
\ No newline at end of file
diff --git a/External/Graphics/Projects.psd b/External/Graphics/Projects.psd
new file mode 100644
index 0000000000..1aae15c912
Binary files /dev/null and b/External/Graphics/Projects.psd differ
diff --git a/External/Plugins/AS2Context/AS2Context.csproj b/External/Plugins/AS2Context/AS2Context.csproj
index a5f1b01a73..f057d414b4 100644
--- a/External/Plugins/AS2Context/AS2Context.csproj
+++ b/External/Plugins/AS2Context/AS2Context.csproj
@@ -1,122 +1,85 @@
-
-
- Debug
- AnyCPU
- 9.0.21022
- 2.0
- {74AD0487-CEF9-43FE-9283-BC6F79539ADE}
- Library
- Properties
- AS2Context
- AS2Context
-
-
-
-
- 3.5
-
-
- v2.0
-
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- ..\..\..\FlashDevelop\Bin\Debug\Plugins\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- ..\..\..\FlashDevelop\Bin\Debug\Plugins\
- TRACE
- prompt
- 4
-
-
- x86
- ..\..\..\FlashDevelop\Bin\Debug\Plugins\
-
-
- x86
- ..\..\..\FlashDevelop\Bin\Debug\Plugins\
- TRACE
- true
-
-
-
-
-
-
-
-
-
-
-
- {61885F70-B4DC-4B44-852D-5D6D03F2A734}
- PluginCore
- False
-
-
- {4EBF2653-9654-4E40-880E-0046B3D6210E}
- ASCompletion
- False
-
-
-
-
-
-
-
-
-
-
-
-
-
- False
- Microsoft .NET Framework 4 %28x86 and x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
+
+
+
+ Debug
+ AnyCPU
+ {74AD0487-CEF9-43FE-9283-BC6F79539ADE}
+ Library
+ Properties
+ AS2Context
+ AS2Context
+ net48
+ true
+ false
+ false
+ false
+ x64;x86;AnyCPU
+
+
+ true
+ full
+ false
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ DEBUG;TRACE
+ prompt
+ 4
+ 9
+
+
+ none
+ true
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ TRACE
+ prompt
+ 4
+ 9
+
+
+ x86
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ DEBUG;TRACE
+ 9
+
+
+ x86
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ TRACE
+ true
+ 9
+
+
+ true
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ DEBUG;TRACE
+ full
+ x64
+ 9
+ prompt
+
+
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ TRACE
+ true
+ x64
+ 9
+ prompt
+
+
+
+
+
+
+
+
+ {61885F70-B4DC-4B44-852D-5D6D03F2A734}
+ PluginCore
+ False
+
+
+ {4EBF2653-9654-4E40-880E-0046B3D6210E}
+ ASCompletion
+ False
+
+
\ No newline at end of file
diff --git a/External/Plugins/AS2Context/AS2Settings.cs b/External/Plugins/AS2Context/AS2Settings.cs
index 6ea90331ff..78739653e4 100644
--- a/External/Plugins/AS2Context/AS2Settings.cs
+++ b/External/Plugins/AS2Context/AS2Settings.cs
@@ -1,21 +1,17 @@
using System;
-using System.Collections.Generic;
-using System.Text;
using System.ComponentModel;
using System.Drawing.Design;
-using System.Windows.Forms;
-using System.Windows.Forms.Design;
-using System.IO;
-using ASCompletion.Context;
-using PluginCore.Localization;
+using ASCompletion.Settings;
+using Ookii.Dialogs;
using PluginCore;
+using PluginCore.Localization;
namespace AS2Context
{
public delegate void ClasspathChangedEvent();
[Serializable]
- public class AS2Settings : ASCompletion.Settings.IContextSettings
+ public class AS2Settings : IContextSettings
{
[field: NonSerialized]
public event ClasspathChangedEvent OnClasspathChanged;
@@ -31,8 +27,8 @@ public class AS2Settings : ASCompletion.Settings.IContextSettings
[LocalizedCategory("ASCompletion.Category.Documentation"), LocalizedDescription("ASCompletion.Description.DocumentationCommandLine"), DefaultValue(DEFAULT_DOC_COMMAND)]
public string DocumentationCommandLine
{
- get { return documentationCommandLine; }
- set { documentationCommandLine = value; }
+ get => documentationCommandLine;
+ set => documentationCommandLine = value;
}
#endregion
@@ -73,7 +69,7 @@ public string DocumentationCommandLine
const bool DEFAULT_FIXPACKAGEAUTOMATICALLY = true;
protected bool checkSyntaxOnSave = DEFAULT_CHECKSYNTAX;
- private bool lazyClasspathExploration = DEFAULT_LAZYMODE;
+ bool lazyClasspathExploration = DEFAULT_LAZYMODE;
protected bool completionListAllTypes = DEFAULT_LISTALL;
protected bool completionShowQualifiedTypes = DEFAULT_QUALIFY;
protected bool completionEnabled = DEFAULT_COMPLETIONENABLED;
@@ -84,42 +80,30 @@ public string DocumentationCommandLine
protected InstalledSDK[] installedSDKs = null;
[Browsable(false)]
- public string LanguageId
- {
- get { return "AS2"; }
- }
+ public string LanguageId => "AS2";
[Browsable(false)]
- public string DefaultExtension
- {
- get { return ".as"; }
- }
+ public string DefaultExtension => ".as";
[Browsable(false)]
- public string CheckSyntaxRunning
- {
- get { return TextHelper.GetString("Info.MTASCRunning"); }
- }
+ public string CheckSyntaxRunning => TextHelper.GetString("Info.MTASCRunning");
[Browsable(false)]
- public string CheckSyntaxDone
- {
- get { return TextHelper.GetString("Info.MTASCDone"); }
- }
+ public string CheckSyntaxDone => TextHelper.GetString("Info.MTASCDone");
[DisplayName("Check Syntax On Save")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.CheckSyntaxOnSave"), DefaultValue(DEFAULT_CHECKSYNTAX)]
public bool CheckSyntaxOnSave
{
- get { return checkSyntaxOnSave; }
- set { checkSyntaxOnSave = value; }
+ get => checkSyntaxOnSave;
+ set => checkSyntaxOnSave = value;
}
[DisplayName("User Classpath")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.UserClasspath")]
public string[] UserClasspath
{
- get { return userClasspath; }
+ get => userClasspath;
set
{
userClasspath = value;
@@ -131,7 +115,7 @@ public string[] UserClasspath
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("AS2Context.Description.MtascPath")]
public InstalledSDK[] InstalledSDKs
{
- get { return installedSDKs; }
+ get => installedSDKs;
set
{
installedSDKs = value;
@@ -141,9 +125,7 @@ public InstalledSDK[] InstalledSDKs
public InstalledSDK GetDefaultSDK()
{
- if (installedSDKs == null || installedSDKs.Length == 0)
- return InstalledSDK.INVALID_SDK;
-
+ if (installedSDKs.IsNullOrEmpty()) return InstalledSDK.INVALID_SDK;
foreach (InstalledSDK sdk in installedSDKs)
if (sdk.IsValid) return sdk;
return InstalledSDK.INVALID_SDK;
@@ -153,16 +135,16 @@ public InstalledSDK GetDefaultSDK()
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.CompletionEnabled"), DefaultValue(DEFAULT_COMPLETIONENABLED)]
public bool CompletionEnabled
{
- get { return completionEnabled; }
- set { completionEnabled = value; }
+ get => completionEnabled;
+ set => completionEnabled = value;
}
[DisplayName("Generate Imports")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.GenerateImports"), DefaultValue(DEFAULT_GENERATEIMPORTS)]
public bool GenerateImports
{
- get { return generateImports; }
- set { generateImports = value; }
+ get => generateImports;
+ set => generateImports = value;
}
///
@@ -172,8 +154,8 @@ public bool GenerateImports
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.CompletionListAllTypes"), DefaultValue(DEFAULT_LISTALL)]
public bool CompletionListAllTypes
{
- get { return completionListAllTypes; }
- set { completionListAllTypes = value; }
+ get => completionListAllTypes;
+ set => completionListAllTypes = value;
}
///
@@ -183,8 +165,8 @@ public bool CompletionListAllTypes
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.CompletionShowQualifiedTypes"), DefaultValue(DEFAULT_QUALIFY)]
public bool CompletionShowQualifiedTypes
{
- get { return completionShowQualifiedTypes; }
- set { completionShowQualifiedTypes = value; }
+ get => completionShowQualifiedTypes;
+ set => completionShowQualifiedTypes = value;
}
///
@@ -194,24 +176,24 @@ public bool CompletionShowQualifiedTypes
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.LazyClasspathExploration"), DefaultValue(DEFAULT_LAZYMODE)]
public bool LazyClasspathExploration
{
- get { return lazyClasspathExploration; }
- set { lazyClasspathExploration = value; }
+ get => lazyClasspathExploration;
+ set => lazyClasspathExploration = value;
}
[DisplayName("Play After Build")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.PlayAfterBuild"), DefaultValue(DEFAULT_PLAY)]
public bool PlayAfterBuild
{
- get { return playAfterBuild; }
- set { playAfterBuild = value; }
+ get => playAfterBuild;
+ set => playAfterBuild = value;
}
[DisplayName("Fix Package Automatically")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.FixPackageAutomatically"), DefaultValue(DEFAULT_FIXPACKAGEAUTOMATICALLY)]
public bool FixPackageAutomatically
{
- get { return fixPackageAutomatically; }
- set { fixPackageAutomatically = value; }
+ get => fixPackageAutomatically;
+ set => fixPackageAutomatically = value;
}
#endregion
@@ -222,16 +204,16 @@ public bool FixPackageAutomatically
const int DEFAULT_FLASHVERSION = 9; // Flash CS3 has a specific FP9 support for AS2
const string DEFAULT_MTASCCHECKPARAMS = "-mx -wimp";
- private int flashVersion = 9;
- private string mmClassPath;
- private bool useMtascIntrinsic = DEFAULT_USEMTASC;
- private string mtascCheckParameters = DEFAULT_MTASCCHECKPARAMS;
+ int flashVersion = 9;
+ string mmClassPath;
+ bool useMtascIntrinsic = DEFAULT_USEMTASC;
+ string mtascCheckParameters = DEFAULT_MTASCCHECKPARAMS;
[DisplayName("Use MTASC Intrinsics")]
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("AS2Context.Description.UseMtascIntrinsic"), DefaultValue(DEFAULT_USEMTASC)]
public bool UseMtascIntrinsic
{
- get { return useMtascIntrinsic; }
+ get => useMtascIntrinsic;
set
{
useMtascIntrinsic = value;
@@ -243,16 +225,16 @@ public bool UseMtascIntrinsic
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("AS2Context.Description.MtascCheckParameters"), DefaultValue(DEFAULT_MTASCCHECKPARAMS)]
public string MtascCheckParameters
{
- get { return mtascCheckParameters; }
- set { mtascCheckParameters = value; }
+ get => mtascCheckParameters;
+ set => mtascCheckParameters = value;
}
[DisplayName("Flash IDE Classpath")]
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("AS2Context.Description.MMClassPath")]
- [Editor(typeof(FolderNameEditor), typeof(UITypeEditor))]
+ [Editor(typeof(VistaFolderNameEditor), typeof(UITypeEditor))]
public string MMClassPath
{
- get { return mmClassPath; }
+ get => mmClassPath;
set {
if (value == mmClassPath) return;
mmClassPath = value;
@@ -264,7 +246,7 @@ public string MMClassPath
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("AS2Context.Description.DefaultFlashVersion"), DefaultValue(DEFAULT_FLASHVERSION)]
public int DefaultFlashVersion
{
- get { return flashVersion; }
+ get => flashVersion;
set {
if (value == flashVersion) return;
if (value >= 6 && value <= 9)
@@ -278,9 +260,9 @@ public int DefaultFlashVersion
#endregion
[Browsable(false)]
- private void FireChanged()
- {
- if (OnClasspathChanged != null) OnClasspathChanged();
- }
+ void FireChanged() => OnClasspathChanged?.Invoke();
+
+ [Browsable(false)]
+ public string AddSpaceAfter { get; set; }
}
}
diff --git a/External/Plugins/AS2Context/Context.cs b/External/Plugins/AS2Context/Context.cs
index 19547df03f..16782d10c2 100644
--- a/External/Plugins/AS2Context/Context.cs
+++ b/External/Plugins/AS2Context/Context.cs
@@ -1,40 +1,36 @@
using System;
-using System.Collections;
-using System.Collections.Specialized;
using System.Collections.Generic;
-using System.Text.RegularExpressions;
using System.IO;
-using System.Diagnostics;
-using System.Windows.Forms;
-using PluginCore;
-using PluginCore.Managers;
-using PluginCore.Controls;
-using ASCompletion.Context;
+using System.Text.RegularExpressions;
using ASCompletion.Completion;
+using ASCompletion.Context;
using ASCompletion.Model;
using ASCompletion.Settings;
-using PluginCore.Localization;
+using PluginCore;
+using PluginCore.Controls;
using PluginCore.Helpers;
+using PluginCore.Localization;
+using PluginCore.Managers;
namespace AS2Context
{
- ///
- /// Actionscript2 context
- ///
- public class Context: ASContext
- {
+ ///
+ /// ActionScript2 context
+ ///
+ public class Context: ASContext
+ {
#region regular_expressions_definitions
- static readonly protected Regex re_CMD_BuildCommand =
+ protected static readonly Regex re_CMD_BuildCommand =
new Regex("@mtasc[\\s]+(?.*)", RegexOptions.Compiled | RegexOptions.Multiline);
- static readonly protected Regex re_SplitParams =
+ protected static readonly Regex re_SplitParams =
new Regex("[\\s](?\\-[A-z]+)", RegexOptions.Compiled | RegexOptions.Singleline);
- static protected readonly Regex re_level =
+ protected static readonly Regex re_level =
new Regex("^_level[0-9]+$", RegexOptions.Compiled | RegexOptions.Singleline);
- static protected readonly Regex re_token =
+ protected static readonly Regex re_token =
new Regex("^[a-z$_][a-z0-9$_]*$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
- static protected readonly Regex re_package =
+ protected static readonly Regex re_package =
new Regex("^[a-z$_][a-z0-9$_.]*$", RegexOptions.IgnoreCase | RegexOptions.Compiled);
- static protected readonly Regex re_lastDot =
+ protected static readonly Regex re_lastDot =
new Regex("\\.[^<]", RegexOptions.RightToLeft | RegexOptions.Compiled);
#endregion
@@ -43,12 +39,12 @@ public class Context: ASContext
protected bool hasLevels = true;
protected string docType;
- private AS2Settings as2settings;
+ readonly AS2Settings as2settings;
public override IContextSettings Settings
{
- get { return settings; }
- set { settings = value; }
+ get => settings;
+ set => settings = value;
}
///
@@ -58,7 +54,7 @@ protected Context()
{
}
- public Context(AS2Settings initSettings)
+ public Context(AS2Settings initSettings)
{
as2settings = initSettings;
@@ -98,19 +94,19 @@ public Context(AS2Settings initSettings)
features.methodModifierDefault = Visibility.Public;
// keywords
+ features.ClassKey = "class";
+ features.InterfaceKey = "interface";
+ features.ExtendsKey = "extends";
+ features.ImplementsKey = "implements";
features.dot = ".";
features.voidKey = "Void";
features.objectKey = "Object";
features.booleanKey = "Boolean";
features.numberKey = "Number";
+ features.stringKey = "String";
features.arrayKey = "Array";
+ features.dynamicKey = "*";
features.importKey = "import";
- features.typesPreKeys = new string[] { "import", "new", "instanceof", "extends", "implements" };
- features.codeKeywords = new string[] {
- "class", "interface", "var", "function", "new", "delete", "instanceof", "return", "break", "continue",
- "if", "else", "for", "in", "while", "do", "switch", "case", "default", "with",
- "null", "undefined", "true", "false", "try", "catch", "finally", "throw"
- };
features.varKey = "var";
features.functionKey = "function";
features.getKey = "get";
@@ -120,74 +116,82 @@ public Context(AS2Settings initSettings)
features.publicKey = "public";
features.privateKey = "private";
features.intrinsicKey = "intrinsic";
-
+ features.ReturnKey = "return";
+ features.typesPreKeys = new[] { "import", "new", "instanceof", "extends", "implements" };
+ features.codeKeywords = new[] {
+ "var", "function", "new", "delete", "instanceof", "return", "break", "continue",
+ "if", "else", "for", "in", "while", "do", "switch", "case", "default", "with",
+ "null", "undefined", "true", "false", "try", "catch", "finally", "throw"
+ };
+ features.accessKeywords = new[] { "override", "public", "private", "intrinsic", "static" };
+ features.declKeywords = new[] { "var", "function" };
+ features.typesKeywords = new[] { "import", "class", "interface" };
features.functionArguments = new MemberModel("arguments", "FunctionArguments", FlagType.Variable | FlagType.LocalVar, 0);
-
+ features.ArithmeticOperators = new HashSet { '+', '-', '*', '/' };
+ features.IncrementDecrementOperators = new[] {"++", "--"};
/* INITIALIZATION */
settings = initSettings;
//BuildClassPath(); // defered to first use
- }
- #endregion
-
- #region classpath management
- ///
- /// Classpathes & classes cache initialisation
- ///
- public override void BuildClassPath()
+ }
+ #endregion
+
+ #region classpath management
+ ///
+ /// Classpathes & classes cache initialization
+ ///
+ public override void BuildClassPath()
{
ReleaseClasspath();
started = true;
- if (as2settings == null) throw new Exception("BuildClassPath() must be overridden");
- if (contextSetup == null)
+ if (as2settings is null) throw new Exception("BuildClassPath() must be overridden");
+ contextSetup ??= new ContextSetupInfos
{
- contextSetup = new ContextSetupInfos();
- contextSetup.Lang = settings.LanguageId;
- contextSetup.Platform = "Flash Player";
- contextSetup.Version = as2settings.DefaultFlashVersion + ".0";
- }
+ Lang = settings.LanguageId,
+ Platform = "Flash Player",
+ Version = as2settings.DefaultFlashVersion + ".0"
+ };
- // external version definition
+ // external version definition
platform = contextSetup.Platform;
majorVersion = as2settings.DefaultFlashVersion;
minorVersion = 0;
ParseVersion(contextSetup.Version, ref majorVersion, ref minorVersion);
-
+
//
- // Class pathes
+ // Class pathes
//
- classPath = new List();
+ classPath = new List();
// MTASC
- string mtascPath = PluginBase.CurrentProject != null
+ var mtascPath = PluginBase.CurrentProject != null
? PluginBase.CurrentProject.CurrentSDK
: PathHelper.ResolvePath(as2settings.GetDefaultSDK().Path);
if (Path.GetExtension(mtascPath) != "") mtascPath = Path.GetDirectoryName(mtascPath);
string path;
- if ((as2settings.UseMtascIntrinsic || String.IsNullOrEmpty(as2settings.MMClassPath))
- && !String.IsNullOrEmpty(mtascPath) && System.IO.Directory.Exists(mtascPath))
- {
- try
- {
+ if ((as2settings.UseMtascIntrinsic || string.IsNullOrEmpty(as2settings.MMClassPath)) && Directory.Exists(mtascPath))
+ {
+ try
+ {
if (majorVersion == 9)
{
path = Path.Combine(mtascPath, "std9");
- if (System.IO.Directory.Exists(path)) AddPath(path);
+ if (Directory.Exists(path)) AddPath(path);
else majorVersion = 8;
}
if (majorVersion == 8)
{
path = Path.Combine(mtascPath, "std8");
- if (System.IO.Directory.Exists(path)) AddPath(path);
+ if (Directory.Exists(path)) AddPath(path);
}
path = Path.Combine(mtascPath, "std");
- if (System.IO.Directory.Exists(path)) AddPath(path);
- }
- catch {}
- }
- // Macromedia/Adobe
- if (!String.IsNullOrEmpty(as2settings.MMClassPath) && System.IO.Directory.Exists(as2settings.MMClassPath))
+ if (Directory.Exists(path)) AddPath(path);
+ }
+ catch {}
+ }
+ // Macromedia/Adobe
+ if (Directory.Exists(as2settings.MMClassPath))
{
if (classPath.Count == 0)
{
@@ -196,44 +200,44 @@ public override void BuildClassPath()
if (tempVersion > 8)
{
path = Path.Combine(as2settings.MMClassPath, "FP" + tempVersion);
- if (System.IO.Directory.Exists(path))
+ if (Directory.Exists(path))
AddPath(path);
// now add FP8
tempVersion = 8;
}
path = Path.Combine(as2settings.MMClassPath, "FP" + Math.Max(7, tempVersion));
- if (System.IO.Directory.Exists(path))
+ if (Directory.Exists(path))
{
PathModel aPath = new PathModel(path, this);
- ManualExploration(aPath, new string[] { "aso", "FP7", "FP8", "FP9" });
+ ManualExploration(aPath, new[] { "aso", "FP7", "FP8", "FP9" });
AddPath(aPath);
}
}
}
- // add external pathes
- List initCP = classPath;
- classPath = new List();
- if (contextSetup.Classpath != null)
- {
- foreach (string cpath in contextSetup.Classpath)
+ // add external pathes
+ var initCP = classPath;
+ classPath = new List();
+ if (contextSetup.Classpath != null)
+ {
+ foreach (var cpath in contextSetup.Classpath)
AddPath(cpath.Trim());
- }
+ }
// add library
AddPath(Path.Combine(PathHelper.LibraryDir, "AS2/classes"));
- // add user pathes from settings
- if (settings.UserClasspath != null && settings.UserClasspath.Length > 0)
- {
- foreach(string cpath in settings.UserClasspath) AddPath(cpath.Trim());
- }
- // add initial pathes
- foreach(PathModel mpath in initCP) AddPath(mpath);
+ // add user pathes from settings
+ if (!settings.UserClasspath.IsNullOrEmpty())
+ {
+ foreach(var cpath in settings.UserClasspath) AddPath(cpath.Trim());
+ }
+ // add initial pathes
+ foreach(var mpath in initCP) AddPath(mpath);
// parse top-level elements
InitTopLevelElements();
if (cFile != null) UpdateTopLevelElements();
-
+
// add current temporaty path
if (temporaryPath != null)
{
@@ -242,58 +246,50 @@ public override void BuildClassPath()
SetTemporaryPath(tempPath);
}
FinalizeClasspath();
- }
-
- ///
- /// Delete current class's ASO file
- ///
- public override void RemoveClassCompilerCache()
- {
- if (as2settings == null) return;
-
- ClassModel pClass = cFile.GetPublicClass();
- if (as2settings.MMClassPath == null || pClass.IsVoid())
- return;
- string package = (cFile.Package.Length > 0) ? cFile.Package + "." : "";
- string packagePath = dirSeparator + package.Replace('.', dirSeparatorChar);
- string file = Path.Combine(as2settings.MMClassPath, "aso") + packagePath + package + pClass.Name + ".aso";
- try
- {
- if (File.Exists(file)) File.Delete(file);
- }
- catch {}
- }
+ }
+
+ ///
+ /// Delete current class's ASO file
+ ///
+ public override void RemoveClassCompilerCache()
+ {
+ if (as2settings is null) return;
+
+ var pClass = cFile.GetPublicClass();
+ if (as2settings.MMClassPath is null || pClass.IsVoid()) return;
+ var package = (cFile.Package.Length > 0) ? cFile.Package + "." : "";
+ var packagePath = dirSeparator + package.Replace('.', dirSeparatorChar);
+ var file = Path.Combine(as2settings.MMClassPath, "aso") + packagePath + package + pClass.Name + ".aso";
+ try
+ {
+ if (File.Exists(file)) File.Delete(file);
+ }
+ catch {}
+ }
#endregion
#region class resolution
-
- public override ClassModel CurrentClass
- {
- get
+
+ public override ClassModel CurrentClass
+ {
+ get
{
- if (cFile == FileModel.Ignore)
+ if (cFile == FileModel.Ignore) return ClassModel.VoidClass;
+ if (cClass is null)
+ {
+ cClass = ClassModel.VoidClass;
+ cFile.OutOfDate = true;
+ }
+ // update class
+ if (cFile.OutOfDate)
{
- return ClassModel.VoidClass;
+ if (cFile.FileName.Length > 0) UpdateCurrentFile(true);
+ // update "this" and "super" special vars
+ UpdateTopLevelElements();
}
- if (cClass == null)
- {
- cClass = ClassModel.VoidClass;
- cFile.OutOfDate = true;
- }
- // update class
- if (cFile.OutOfDate)
- {
- if (cFile.FileName.Length > 0)
- {
- string prevClassName = cClass.Name;
- UpdateCurrentFile(true);
- }
- // update "this" and "super" special vars
- UpdateTopLevelElements();
- }
- return cClass;
- }
- }
+ return cClass;
+ }
+ }
///
/// Evaluates the visibility of one given type from another.
@@ -304,14 +300,13 @@ public override ClassModel CurrentClass
/// Completion visibility
public override Visibility TypesAffinity(ClassModel inClass, ClassModel withClass)
{
- if (inClass == null || withClass == null) return Visibility.Public;
+ if (inClass is null || withClass is null) return Visibility.Public;
// inheritance affinity
- ClassModel tmp = inClass;
- while (!tmp.IsVoid())
+ var type = inClass;
+ while (!type.IsVoid())
{
- if (tmp.Type == withClass.Type)
- return Visibility.Public | Visibility.Private;
- tmp = tmp.Extends;
+ if (type.Type == withClass.Type) return Visibility.Public | Visibility.Private;
+ type = type.Extends;
}
// public only
return Visibility.Public;
@@ -325,8 +320,9 @@ public override Visibility TypesAffinity(ClassModel inClass, ClassModel withClas
/// Inherited type
public override string DefaultInheritance(string package, string classname)
{
- if (package.Length == 0 && classname == features.objectKey) return features.voidKey;
- else return features.objectKey;
+ return package.Length == 0 && classname == features.objectKey
+ ? features.voidKey
+ : features.objectKey;
}
///
@@ -336,51 +332,47 @@ public override string DefaultInheritance(string package, string classname)
/// Response structure
public override void ResolveTopLevelElement(string token, ASResult result)
{
- if (topLevel != null && topLevel.Members.Count > 0)
+ if (topLevel is null || topLevel.Members.Count == 0) return;
+ // current class
+ var inClass = Context.CurrentClass;
+ if (token == "this")
+ {
+ result.Member = topLevel.Members.Search("this");
+ if (inClass.IsVoid()) inClass = Context.ResolveType(result.Member.Type, null);
+ result.Type = inClass;
+ result.InFile = Context.CurrentModel;
+ result.RelClass = Context.CurrentClass;
+ return;
+ }
+ if (token == "super")
{
- // current class
- ClassModel inClass = ASContext.Context.CurrentClass;
- if (token == "this")
+ if (inClass.IsVoid())
{
- result.Member = topLevel.Members.Search("this", 0, 0);
- if (inClass.IsVoid())
- inClass = ASContext.Context.ResolveType(result.Member.Type, null);
- result.Type = inClass;
- result.InFile = ASContext.Context.CurrentModel;
- return;
+ var thisMember = topLevel.Members.Search("this");
+ inClass = Context.ResolveType(thisMember.Type, null);
}
- else if (token == "super")
+ inClass.ResolveExtends();
+ var extends = inClass.Extends;
+ if (!extends.IsVoid())
{
- if (inClass.IsVoid())
- {
- MemberModel thisMember = topLevel.Members.Search("this", 0, 0);
- inClass = ASContext.Context.ResolveType(thisMember.Type, null);
- }
- inClass.ResolveExtends();
- ClassModel extends = inClass.Extends;
- if (!extends.IsVoid())
- {
- result.Member = topLevel.Members.Search("super", 0, 0);
- result.Type = extends;
- result.InFile = extends.InFile;
- return;
- }
+ result.Member = topLevel.Members.Search("super");
+ result.Type = extends;
+ result.InFile = extends.InFile;
+ result.RelClass = Context.CurrentClass;
+ return;
}
+ }
- // other top-level elements
- ASComplete.FindMember(token, topLevel, result, 0, 0);
- if (!result.IsNull()) return;
+ // other top-level elements
+ ASComplete.FindMember(token, topLevel, result, 0, 0);
+ if (!result.IsNull()) return;
- // special _levelN
- if (hasLevels && token.StartsWith("_") && re_level.IsMatch(token))
- {
- result.Member = new MemberModel();
- result.Member.Name = token;
- result.Member.Flags = FlagType.Variable;
- result.Member.Type = "MovieClip";
- result.Type = ResolveType("MovieClip", null);
- result.InFile = topLevel;
- }
+ // special _levelN
+ if (hasLevels && token.StartsWith('_') && re_level.IsMatch(token))
+ {
+ result.Member = new MemberModel {Name = token, Flags = FlagType.Variable, Type = "MovieClip"};
+ result.Type = ResolveType("MovieClip", null);
+ result.InFile = topLevel;
}
}
@@ -391,15 +383,13 @@ public override void ResolveTopLevelElement(string token, ASResult result)
/// Current file
public override MemberList ResolveImports(FileModel inFile)
{
- if (inFile == cFile && completionCache.Imports != null)
- return completionCache.Imports;
-
- MemberList imports = new MemberList();
- if (inFile == null) return imports;
+ if (inFile == cFile && completionCache.Imports != null) return completionCache.Imports;
+ var imports = new MemberList();
+ if (inFile is null) return imports;
bool filterImports = (inFile == cFile) && inFile.Classes.Count > 1;
int lineMin = (filterImports && inPrivateSection) ? inFile.PrivateSectionIndex : 0;
int lineMax = (filterImports && inPrivateSection) ? int.MaxValue : inFile.PrivateSectionIndex;
- foreach (MemberModel item in inFile.Imports)
+ foreach (var item in inFile.Imports)
{
if (filterImports && (item.LineFrom < lineMin || item.LineFrom > lineMax)) continue;
if (item.Name != "*")
@@ -407,18 +397,18 @@ public override MemberList ResolveImports(FileModel inFile)
if (settings.LazyClasspathExploration) imports.Add(item);
else
{
- ClassModel type = ResolveType(item.Type, null);
+ var type = ResolveType(item.Type, null);
if (!type.IsVoid()) imports.Add(type);
else
{
// package-level declarations
- int p = item.Type.LastIndexOf('.');
- if (p < 0) continue;
- string package = item.Type.Substring(0, p);
- string token = item.Type.Substring(p+1);
- FileModel pack = ResolvePackage(package, false);
- if (pack == null) continue;
- MemberModel member = pack.Members.Search(token, 0, 0);
+ var p = item.Type.LastIndexOf('.');
+ if (p == -1) continue;
+ var package = item.Type.Substring(0, p);
+ var token = item.Type.Substring(p+1);
+ var pack = ResolvePackage(package, false);
+ if (pack is null) continue;
+ var member = pack.Members.Search(token);
if (member != null) imports.Add(member);
}
}
@@ -426,14 +416,11 @@ public override MemberList ResolveImports(FileModel inFile)
else
{
// classes matching wildcard
- FileModel matches = ResolvePackage(item.Type.Substring(0, item.Type.Length - 2), false);
-
+ var matches = ResolvePackage(item.Type.Substring(0, item.Type.Length - 2), false);
if (matches != null)
{
- foreach (MemberModel import in matches.Imports)
- imports.Add(import);
- foreach (MemberModel member in matches.Members)
- imports.Add(member);
+ imports.Add(matches.Imports);
+ imports.Add(matches.Members);
}
}
}
@@ -450,42 +437,38 @@ public override MemberList ResolveImports(FileModel inFile)
/// Position in the file
public override bool IsImported(MemberModel member, int atLine)
{
- FileModel cFile = ASContext.Context.CurrentModel;
- string fullName = member.Type;
- string name = member.Name;
- int lineMin = (ASContext.Context.InPrivateSection) ? cFile.PrivateSectionIndex : 0;
- int lineMax = atLine;
+ if (member == ClassModel.VoidClass) return false;
+ var cFile = Context.CurrentModel;
+ var fullName = member.Type;
+ var name = member.Name;
+ var lineMin = (Context.InPrivateSection) ? cFile.PrivateSectionIndex : 0;
+ var lineMax = atLine;
foreach (MemberModel import in cFile.Imports)
{
- if (import.LineFrom >= lineMin && import.LineFrom <= lineMax && import.Name == name)
- {
- if (import.Type != fullName) throw new Exception("Ambiguous Type");
- return true;
- }
- else if (import.Name == "*" && import.Type.Replace("*", name) == fullName)
+ if (import.LineFrom >= lineMin && import.LineFrom <= lineMax && import.Name == name && import.Type == fullName)
return true;
+ if (import.Name == "*" && import.Type.Replace("*", name) == fullName) return true;
}
return false;
}
- ///
- /// Retrieves a class model from its name
- ///
- /// Class (short or full) name
- /// Current file
- /// A parsed class or an empty ClassModel if the class is not found
+ ///
+ /// Retrieves a class model from its name
+ ///
+ /// Class (short or full) name
+ /// Current file
+ /// A parsed class or an empty ClassModel if the class is not found
public override ClassModel ResolveType(string cname, FileModel inFile)
- {
+ {
// unknown type
- if (string.IsNullOrEmpty(cname) || cname == features.voidKey || classPath == null)
+ if (string.IsNullOrEmpty(cname) || cname == features.voidKey || classPath is null)
return ClassModel.VoidClass;
// typed array
- if (cname.IndexOf('@') > 0)
- return ResolveTypeIndex(cname, inFile);
+ if (cname.Contains('@')) return ResolveTypeIndex(cname, inFile);
- string package = "";
- Match m = re_lastDot.Match(cname);
+ var package = "";
+ var m = re_lastDot.Match(cname);
if (m.Success)
{
package = cname.Substring(0, m.Index);
@@ -496,7 +479,7 @@ public override ClassModel ResolveType(string cname, FileModel inFile)
if (inFile != null && inFile.Classes.Count > 0)
{
foreach (ClassModel aClass in inFile.Classes)
- if (aClass.Name == cname && (package == "" || package == inFile.Package))
+ if (aClass.Name == cname && (package.Length == 0 || package == inFile.Package))
return aClass;
}
@@ -504,7 +487,7 @@ public override ClassModel ResolveType(string cname, FileModel inFile)
string inPackage = (features.hasPackages && inFile != null) ? inFile.Package : "";
// search in imported classes
- if (package == "" && inFile != null)
+ if (package.Length == 0 && inFile != null)
{
foreach (MemberModel import in inFile.Imports)
{
@@ -514,22 +497,22 @@ public override ClassModel ResolveType(string cname, FileModel inFile)
package = import.Type.Substring(0, import.Type.Length - cname.Length - 1);
break;
}
- else if (features.hasImportsWildcard)
+ if (features.hasImportsWildcard)
{
if (import.Name == "*" && import.Type.Length > 2)
{
// try wildcards
- string testPackage = import.Type.Substring(0, import.Type.Length - 2);
+ var testPackage = import.Type.Substring(0, import.Type.Length - 2);
if (settings.LazyClasspathExploration)
{
- ClassModel testClass = GetModel(testPackage, cname, inPackage);
+ var testClass = GetModel(testPackage, cname, inPackage);
if (!testClass.IsVoid()) return testClass;
}
else
{
- FileModel pack = ResolvePackage(testPackage, false);
- if (pack == null) continue;
- MemberModel found = pack.Imports.Search(cname, 0, 0);
+ var pack = ResolvePackage(testPackage, false);
+ if (pack is null) continue;
+ var found = pack.Imports.Search(cname);
if (found != null) return ResolveType(found.Type, null);
}
}
@@ -538,14 +521,14 @@ public override ClassModel ResolveType(string cname, FileModel inFile)
{
if (settings.LazyClasspathExploration)
{
- ClassModel testClass = GetModel(import.Type, cname, inPackage);
+ var testClass = GetModel(import.Type, cname, inPackage);
if (!testClass.IsVoid()) return testClass;
}
else
{
- FileModel pack = ResolvePackage(import.Type, false);
- if (pack == null) continue;
- MemberModel found = pack.Imports.Search(cname, 0, 0);
+ var pack = ResolvePackage(import.Type, false);
+ if (pack is null) continue;
+ var found = pack.Imports.Search(cname);
if (found != null) return ResolveType(found.Type, null);
}
}
@@ -556,10 +539,35 @@ public override ClassModel ResolveType(string cname, FileModel inFile)
return GetModel(package, cname, inPackage);
}
+ public override ClassModel ResolveToken(string token, FileModel inFile)
+ {
+ var tokenLength = token?.Length ?? 0;
+ if (tokenLength > 0)
+ {
+ if (token == "true" || token == "false") return ResolveType(features.booleanKey, inFile);
+ var first = token[0];
+ if (char.IsDigit(token, 0)
+ // for example: -1, +1
+ || (tokenLength > 1 && (first == '-' || first == '+') && char.IsDigit(token, 1))
+ // for example: --1, ++1
+ || (tokenLength > 2 && ((first == '-' && token[1] == '-') || (first == '+' && token[1] == '+')) && char.IsDigit(token, 2)))
+ {
+ if (features.IntegerKey is null) return ResolveType(features.numberKey, inFile);
+ if (token.Contains('.') || token.Contains('e')) return ResolveType(features.numberKey, inFile);
+ return ResolveType(features.IntegerKey, inFile);
+ }
+ var last = token[tokenLength - 1];
+ if (first == '{' && last == '}') return ResolveType(features.objectKey, inFile);
+ if (first == '[' && last == ']') return ResolveType(features.arrayKey, inFile);
+ if (tokenLength > 1 && (first == '"' || first == '\'') && last == first) return ResolveType(features.stringKey, inFile);
+ }
+ return base.ResolveToken(token, inFile);
+ }
+
protected ClassModel ResolveTypeIndex(string cname, FileModel inFile)
{
int p = cname.IndexOf('@');
- if (p < 0) return ClassModel.VoidClass;
+ if (p == -1) return ClassModel.VoidClass;
string indexType = cname.Substring(p + 1);
string baseType = cname.Substring(0, p);
@@ -569,22 +577,22 @@ protected ClassModel ResolveTypeIndex(string cname, FileModel inFile)
ClassModel indexClass = ResolveType(indexType, inFile);
- if (baseType == "Object" || baseType == "Dynamic")
+ if (baseType == inFile.Context.Features.dynamicKey)
{
- if (!indexClass.IsVoid()) return indexClass;
- return MakeCustomObjectClass(originalClass, indexType);
+ return !indexClass.IsVoid()
+ ? indexClass
+ : MakeCustomObjectClass(originalClass, indexType);
}
if (indexClass.IsVoid()) return originalClass;
indexType = indexClass.QualifiedName;
- FileModel aFile = originalClass.InFile;
+ var aFile = originalClass.InFile;
// is the type already cloned?
- foreach (ClassModel otherClass in aFile.Classes)
+ foreach (var otherClass in aFile.Classes)
if (otherClass.IndexType == indexType) return otherClass;
// clone the type
- ClassModel aClass = originalClass.Clone() as ClassModel;
-
+ var aClass = originalClass.Clone();
aClass.Name = baseType + "@" + indexType;
aClass.IndexType = indexType;
@@ -596,19 +604,18 @@ protected ClassModel ResolveTypeIndex(string cname, FileModel inFile)
}
// replace 'Object' and '*' by the index type
else
- foreach (MemberModel member in aClass.Members)
- {
- if (member.Type == features.objectKey || member.Type == "*") member.Type = indexType;
- if (member.Parameters != null)
+ foreach (var member in aClass.Members)
{
- foreach (MemberModel param in member.Parameters)
+ if (member.Type == features.objectKey || member.Type == "*") member.Type = indexType;
+ if (member.Parameters != null)
{
- if (param.Name == "value"
- && (param.Type == features.objectKey || param.Type == "*"))
- param.Type = indexType;
+ foreach (var param in member.Parameters)
+ {
+ if (param.Name == "value" && (param.Type == features.objectKey || param.Type == "*"))
+ param.Type = indexType;
+ }
}
}
- }
aFile.Classes.Add(aClass);
return aClass;
@@ -616,21 +623,24 @@ protected ClassModel ResolveTypeIndex(string cname, FileModel inFile)
protected ClassModel MakeCustomObjectClass(ClassModel objectClass, string indexType)
{
- foreach (ClassModel c in objectClass.InFile.Classes)
- if (c.IndexType == indexType) return c;
-
- ClassModel aClass = new ClassModel();
- aClass.Flags = objectClass.Flags;
- aClass.Access = objectClass.Access;
- aClass.ExtendsType = "";
- aClass.Name = objectClass.QualifiedName + "@" + indexType;
- aClass.IndexType = indexType;
- aClass.InFile = objectClass.InFile;
+ foreach (var c in objectClass.InFile.Classes)
+ if (c.IndexType == indexType)
+ return c;
- FlagType flags = FlagType.Dynamic | FlagType.Variable | FlagType.AutomaticVar;
- foreach (string prop in indexType.Split(','))
+ var aClass = new ClassModel
{
- MemberModel member = new MemberModel(prop, "", flags, Visibility.Public);
+ Flags = objectClass.Flags,
+ Access = objectClass.Access,
+ ExtendsType = "",
+ Name = objectClass.QualifiedName + "@" + indexType,
+ IndexType = indexType,
+ InFile = objectClass.InFile
+ };
+
+ const FlagType flags = FlagType.Dynamic | FlagType.Variable | FlagType.AutomaticVar;
+ foreach (var prop in indexType.Split(','))
+ {
+ var member = new MemberModel(prop, "", flags, Visibility.Public);
aClass.Members.Add(member);
}
objectClass.InFile.Classes.Add(aClass);
@@ -644,16 +654,16 @@ protected ClassModel MakeCustomObjectClass(ClassModel objectClass, string indexT
/// Class name
/// Package reference for resolution
///
- public override ClassModel GetModel(string package, string cname, string inPackage)
+ public override ClassModel GetModel(string package, string cname, string? inPackage)
{
- if (!settings.LazyClasspathExploration)
+ if (!settings.LazyClasspathExploration)
{
bool testSamePackage = package.Length == 0 && features.hasPackages;
bool testModule = package.Length > 0 && features.hasModules;
- foreach (PathModel aPath in classPath)
+ foreach (var aPath in classPath)
if (aPath.IsValid && !aPath.Updating)
{
- ClassModel found = LookupClass(package, cname, inPackage, testSamePackage, testModule, aPath);
+ var found = LookupClass(package, cname, inPackage, testSamePackage, testModule, aPath);
if (found != null) return found;
}
if (classPath.Count > 0 && classPath[0].IsTemporaryPath)
@@ -669,8 +679,7 @@ public override ClassModel GetModel(string package, string cname, string inPacka
model = LocateClassFile(classPath[0], fileName);
}
catch { }
- if (model != null) return model;
- else return ClassModel.VoidClass;
+ return model ?? ClassModel.VoidClass;
}
}
else
@@ -681,68 +690,76 @@ public override ClassModel GetModel(string package, string cname, string inPacka
foreach (PathModel aPath in classPath) if (aPath.IsValid && !aPath.Updating)
{
- ClassModel model = LocateClassFile(aPath, fileName);
+ var model = LocateClassFile(aPath, fileName);
if (model != null) return model;
}
}
return ClassModel.VoidClass;
- }
+ }
- private ClassModel LookupClass(string package, string cname, string inPackage, bool testSamePackage, bool testModule, PathModel aPath)
+ ClassModel LookupClass(string package, string cname, string? inPackage, bool testSamePackage, bool testModule, PathModel aPath)
{
- bool matchParentPackage = testSamePackage && features.hasFriendlyParentPackages;
-
- ClassModel found = null;
- int pLen = inPackage.Length;
-
- aPath.ForeachFile((aFile) =>
+ ClassModel result = null;
+ inPackage ??= string.Empty;
+ var matchParentPackage = testSamePackage && features.hasFriendlyParentPackages;
+ var pLen = inPackage.Length;
+ aPath.ForeachFile(aFile =>
{
- string pkg = aFile.Package;
+ var count = aFile.Classes.Count;
+ if (count == 0) return true;
+ var pkg = aFile.Package;
// qualified path
- if (pkg == package && aFile.Classes.Count > 0)
+ if (pkg == package)
{
- foreach (ClassModel aClass in aFile.Classes)
- if (aClass.Name == cname && (aFile.Module == "" || aFile.Module == aClass.Name))
+ for (var i = 0; i < count; i++)
+ {
+ var aClass = aFile.Classes[i];
+ if (aClass.Name == cname && (pkg == "" || aFile.Module == "" || aFile.Module == aClass.Name))
{
- found = aClass;
+ result = aClass;
return false;
}
+ }
}
- else if (testModule && aFile.FullPackage == package && aFile.Classes.Count > 0)
+ else if (testModule && aFile.FullPackage == package)
{
- foreach (ClassModel aClass in aFile.Classes)
+ for (var i = 0; i < count; i++)
+ {
+ var aClass = aFile.Classes[i];
if (aClass.Name == cname)
{
- found = aClass;
+ result = aClass;
return false;
}
+ }
}
// in the same (or parent) package
- else if (testSamePackage)
+ else if (testSamePackage && (pkg == inPackage || (matchParentPackage && pkg.Length < pLen && inPackage.StartsWithOrdinal(pkg + "."))))
{
- if (inPackage == pkg || (matchParentPackage && pkg.Length < pLen && inPackage.StartsWith(pkg + ".")))
- foreach (ClassModel aClass in aFile.Classes)
- if (aClass.Name == cname /*&& (aFile.Module == "" || aFile.Module == aClass.Name)*/)
- {
- found = aClass;
- return false;
- }
+ for (var i = 0; i < count; i++)
+ {
+ var aClass = aFile.Classes[i];
+ if (aClass.Name == cname)
+ {
+ result = aClass;
+ return false;
+ }
+ }
}
return true;
});
- return found;
+ return result;
}
- private ClassModel LocateClassFile(PathModel aPath, string fileName)
+ ClassModel LocateClassFile(PathModel aPath, string fileName)
{
if (!aPath.IsValid) return null;
try
{
string path = Path.Combine(aPath.Path, fileName);
// cached file
- if (aPath.HasFile(path))
+ if (aPath.TryGetFile(path, out var nFile))
{
- FileModel nFile = aPath.GetFile(path);
if (nFile.Context != this)
{
// not associated with this context -> refresh
@@ -752,9 +769,9 @@ private ClassModel LocateClassFile(PathModel aPath, string fileName)
return nFile.GetPublicClass();
}
// non-cached existing file
- else if (File.Exists(path))
+ if (File.Exists(path))
{
- FileModel nFile = GetFileModel(path);
+ nFile = GetFileModel(path);
if (nFile != null)
{
aPath.AddFile(nFile);
@@ -782,110 +799,104 @@ public override void CheckModel(bool onFileOpen)
base.CheckModel(onFileOpen);
return;
}
- string prevPackage = (onFileOpen) ? null : cFile.Package;
- string prevCname = (onFileOpen) ? null : cFile.GetPublicClass().Name;
+ string prevPackage = null;
+ string prevCname = null;
+ if(onFileOpen)
+ {
+ prevPackage = cFile.Package;
+ prevCname = cFile.GetPublicClass().Name;
+ }
// refresh model
base.CheckModel(onFileOpen);
if (!MessageBar.Locked && features.checkFileName && cFile.Version > 1)
{
- string package = cFile.Package;
- ClassModel pClass = cFile.GetPublicClass();
- if (package.Length > 0)
+ var package = cFile.Package;
+ var pClass = cFile.GetPublicClass();
+ var pathname = package.Replace('.', Path.DirectorySeparatorChar);
+ var fullpath = Path.GetDirectoryName(cFile.FileName);
+ if (package.Length == 0 || !fullpath.EndsWithOrdinal(pathname))
{
- string pathname = package.Replace('.', Path.DirectorySeparatorChar);
- string fullpath = Path.GetDirectoryName(cFile.FileName);
- if (!fullpath.ToUpper().EndsWith(pathname.ToUpper()))
+ if (settings.FixPackageAutomatically && PluginBase.MainForm.CurrentDocument?.SciControl is { } sci)
{
- if (settings.FixPackageAutomatically && CurSciControl != null)
+ var packagePattern = cFile.Context.Settings.LanguageId == "AS2"
+ ? new Regex("class\\s+(" + cFile.Package.Replace(".", "\\.") + "\\." + pClass.Name + ')')
+ : new Regex("package\\s+(" + cFile.Package.Replace(".", "\\.") + ')');
+
+ var regexPackageLine = "";
+ var pos = -1;
+ var txt = "";
+ var p = 0;
+ var counter = sci.Length;
+ while (p < counter)
{
- bool isAs2 = cFile.Context.Settings.LanguageId == "AS2";
-
- int pos = -1;
-
- string txt = "";
- string regexPackageLine = "";
-
- int counter = CurSciControl.Length;
- int p = 0;
- Regex packagePattern = null;
- if (isAs2)
+ var c = (char) sci.CharAt(p++);
+ txt += c;
+ if (txt.Length > 5 && c <= 32)
{
- packagePattern = new Regex("class\\s+(" + cFile.Package.Replace(".", "\\.") + "\\." + pClass.Name + ')');
- }
- else
- {
- packagePattern = new Regex("package\\s+(" + cFile.Package.Replace(".", "\\.") + ')');
- }
- while (p < counter)
- {
- char c = (char)CurSciControl.CharAt(p++);
- txt += c;
- if (txt.Length > 5 && c <= 32)
+ var m = packagePattern.Match(txt);
+ if (m.Success)
{
- Match m = packagePattern.Match(txt);
- if (m.Success)
- {
- pos = m.Groups[1].Index;
- regexPackageLine = m.Value;
- break;
- }
+ pos = m.Groups[1].Index;
+ regexPackageLine = m.Value;
+ break;
}
}
+ }
- if (regexPackageLine.Length > 0 && pos > -1)
+ if (regexPackageLine.Length > 0 && pos > -1)
+ {
+ var orgid = "Info.PackageDontMatchFilePath";
+ var classpaths = Context.Classpath;
+ if (classpaths != null)
{
- string orgid = "Info.PackageDontMatchFilePath";
- List classpaths = Context.Classpath;
- if (classpaths != null)
+ string correctPath = null;
+ foreach (var pm in classpaths)
{
- string correctPath = null;
- foreach (PathModel pm in classpaths)
+ if (fullpath.Contains(pm.Path) && fullpath.Length > pm.Path.Length)
{
- if (fullpath.IndexOf(pm.Path) > -1 && fullpath.Length > pm.Path.Length)
- {
- correctPath = fullpath.Substring(pm.Path.Length + 1);
- }
- else if (fullpath.ToLower() == pm.Path.ToLower())
- {
- correctPath = ""; // We are in root, no package..
- }
+ correctPath = fullpath.Substring(pm.Path.Length + 1);
}
- if (correctPath != null)
+ else if (fullpath.ToLower() == pm.Path.ToLower())
{
- correctPath = correctPath.Replace(Path.DirectorySeparatorChar, '.');
- CurSciControl.SetSel(pos, pos + cFile.Package.Length);
- CurSciControl.ReplaceSel(correctPath);
- orgid = "Info.PackageDidntMatchFilePath";
+ correctPath = ""; // We are in root, no package..
}
}
- string org = TextHelper.GetString(orgid);
- string msg = String.Format(org, package) + "\n" + cFile.FileName;
- MessageBar.ShowWarning(msg);
+ if (correctPath == "" && package.Length == 0) return;
+ if (correctPath != null)
+ {
+ correctPath = correctPath.Replace(Path.DirectorySeparatorChar, '.');
+ sci.SetSel(pos, pos + cFile.Package.Length);
+ sci.ReplaceSel(correctPath);
+ orgid = "Info.PackageDidntMatchFilePath";
+ }
}
-
- }
- else
- {
- string org = TextHelper.GetString("Info.PackageDontMatchFilePath");
- string msg = String.Format(org, package) + "\n" + cFile.FileName;
+ var org = TextHelper.GetString(orgid);
+ var msg = string.Format(org, package) + "\n" + cFile.FileName;
MessageBar.ShowWarning(msg);
}
- return;
}
- else MessageBar.HideWarning();
+ else
+ {
+ var org = TextHelper.GetString("Info.PackageDontMatchFilePath");
+ var msg = string.Format(org, package) + "\n" + cFile.FileName;
+ MessageBar.ShowWarning(msg);
+ }
+ return;
}
+
+ MessageBar.HideWarning();
if (!pClass.IsVoid())
{
string cname = pClass.Name;
if (prevPackage != package || prevCname != cname)
{
- if (package.Length > 0) cname = package + "." + cname;
- string filename = cname.Replace('.', Path.DirectorySeparatorChar) + Path.GetExtension(cFile.FileName);
- if (!cFile.FileName.ToUpper().EndsWith(filename.ToUpper()))
+ cname = package + "." + cname;
+ var filename = cname.Replace('.', Path.DirectorySeparatorChar) + Path.GetExtension(cFile.FileName);
+ if (!cFile.FileName.ToUpper().EndsWithOrdinal(filename.ToUpper()))
{
string org = TextHelper.GetString("Info.TypeDontMatchFileName");
- string msg = String.Format(org, cname) + "\n" + cFile.FileName;
+ string msg = string.Format(org, cname) + "\n" + cFile.FileName;
MessageBar.ShowWarning(msg);
}
else MessageBar.HideWarning();
@@ -894,50 +905,51 @@ public override void CheckModel(bool onFileOpen)
}
}
-
- ///
- /// Update Flash intrinsic known vars
- ///
- protected override void UpdateTopLevelElements()
- {
- MemberModel special;
- special = topLevel.Members.Search("this", 0, 0);
- if (special != null)
- {
+ ///
+ /// Update Flash intrinsic known vars
+ ///
+ protected override void UpdateTopLevelElements()
+ {
+ var special = topLevel.Members.Search("this");
+ if (special != null)
+ {
if (!cClass.IsVoid()) special.Type = cClass.QualifiedName;
else special.Type = (cFile.Version > 1) ? features.voidKey : docType;
- }
- special = topLevel.Members.Search("super", 0, 0);
- if (special != null)
- {
+ }
+ special = topLevel.Members.Search("super");
+ if (special != null)
+ {
cClass.ResolveExtends();
- ClassModel extends = cClass.Extends;
- if (!extends.IsVoid()) special.Type = extends.QualifiedName;
+ var extends = cClass.Extends;
+ if (!extends.IsVoid()) special.Type = extends.QualifiedName;
else special.Type = (cFile.Version > 1) ? features.voidKey : features.objectKey;
- }
- }
-
- ///
- /// Prepare AS2 intrinsic known vars/methods/classes
- ///
- protected override void InitTopLevelElements()
- {
- string filename = "toplevel.as";
+ }
+ }
+
+ ///
+ /// Prepare AS2 intrinsic known vars/methods/classes
+ ///
+ protected override void InitTopLevelElements()
+ {
+ var filename = "toplevel.as";
topLevel = new FileModel(filename);
// search top-level declaration
- foreach(PathModel aPath in classPath)
- if (File.Exists(Path.Combine(aPath.Path, filename)))
+ foreach (var aPath in classPath)
{
- filename = Path.Combine(aPath.Path, filename);
- topLevel = GetCachedFileModel(filename);
- break;
+ var path = Path.Combine(aPath.Path, filename);
+ if (File.Exists(path))
+ {
+ filename = path;
+ topLevel = GetCachedFileModel(filename);
+ break;
+ }
}
if (File.Exists(filename))
{
// MTASC toplevel-style declaration:
- ClassModel tlClass = topLevel.GetPublicClass();
+ var tlClass = topLevel.GetPublicClass();
if (!tlClass.IsVoid())
{
topLevel.Members = tlClass.Members;
@@ -945,26 +957,17 @@ protected override void InitTopLevelElements()
topLevel.Classes = new List();
}
}
- // not found
- else
- {
- //ErrorHandler.ShowInfo("Top-level elements class not found. Please check your Program Settings.");
- }
-
- if (topLevel.Members.Search("_root", 0, 0) == null)
- topLevel.Members.Add(new MemberModel("_root", docType, FlagType.Variable, Visibility.Public));
- if (topLevel.Members.Search("_global", 0, 0) == null)
- topLevel.Members.Add(new MemberModel("_global", features.objectKey, FlagType.Variable, Visibility.Public));
- if (topLevel.Members.Search("this", 0, 0) == null)
- topLevel.Members.Add(new MemberModel("this", "", FlagType.Variable, Visibility.Public));
- if (topLevel.Members.Search("super", 0, 0) == null)
- topLevel.Members.Add(new MemberModel("super", "", FlagType.Variable, Visibility.Public));
- if (topLevel.Members.Search(features.voidKey, 0, 0) == null)
- topLevel.Members.Add(new MemberModel(features.voidKey, "", FlagType.Class | FlagType.Intrinsic, Visibility.Public));
- topLevel.Members.Sort();
- foreach (MemberModel member in topLevel.Members)
+ // not found
+
+ if (!topLevel.Members.Contains("_root")) topLevel.Members.Add(new MemberModel("_root", docType, FlagType.Variable, Visibility.Public));
+ if (!topLevel.Members.Contains("_global")) topLevel.Members.Add(new MemberModel("_global", features.objectKey, FlagType.Variable, Visibility.Public));
+ if (!topLevel.Members.Contains("this")) topLevel.Members.Add(new MemberModel("this", string.Empty, FlagType.Variable, Visibility.Public));
+ if (!topLevel.Members.Contains("super")) topLevel.Members.Add(new MemberModel("super", string.Empty, FlagType.Variable, Visibility.Public));
+ if (!topLevel.Members.Contains(features.voidKey)) topLevel.Members.Add(new MemberModel(features.voidKey, string.Empty, FlagType.Class | FlagType.Intrinsic, Visibility.Public));
+ topLevel.Members.Sort();
+ foreach (var member in topLevel.Members)
member.Flags |= FlagType.Intrinsic;
- }
+ }
///
/// Retrieves a package content
@@ -973,130 +976,123 @@ protected override void InitTopLevelElements()
/// Force file system exploration
/// Package folders and types
public override FileModel ResolvePackage(string name, bool lazyMode)
- {
- if (name == null) name = "";
+ {
+ if (name is null) name = "";
else if (!re_package.IsMatch(name)) return null;
-
- FileModel pModel = new FileModel();
- pModel.Package = name;
- pModel.OutOfDate = false;
-
- string packagePath = name.Replace('.', dirSeparatorChar);
- foreach (PathModel aPath in classPath) if (aPath.IsValid && !aPath.Updating)
- {
- // explore file system
- if (lazyMode || settings.LazyClasspathExploration || aPath.IsTemporaryPath)
+ var pModel = new FileModel {Package = name, OutOfDate = false};
+ var packagePath = name.Replace('.', dirSeparatorChar);
+ foreach (PathModel aPath in classPath)
+ if (aPath.IsValid && !aPath.Updating)
{
- string path = Path.Combine(aPath.Path, packagePath);
- if (aPath.IsValid && System.IO.Directory.Exists(path))
+ // explore file system
+ if (lazyMode || settings.LazyClasspathExploration || aPath.IsTemporaryPath)
{
- try
+ var path = Path.Combine(aPath.Path, packagePath);
+ if (Directory.Exists(path))
{
- PopulatePackageEntries(name, path, pModel.Imports);
- PopulateClassesEntries(name, path, pModel.Imports);
- }
- catch (Exception ex)
- {
- ErrorManager.ShowError(ex);
+ try
+ {
+ PopulatePackageEntries(name, path, pModel.Imports);
+ PopulateClassesEntries(name, path, pModel.Imports);
+ }
+ catch (Exception ex)
+ {
+ ErrorManager.ShowError(ex);
+ }
}
}
- }
- // explore parsed models
- else
- {
- string prevPackage = null;
- string packagePrefix = name.Length > 0 ? name + "." : "";
- int nameLen = name.Length + 1;
- aPath.ForeachFile((model) =>
+ // explore parsed models
+ else
{
- if (!model.HasPackage)
- return true; // skip
- string package = model.Package;
- if (package == name)
+ string prevPackage = null;
+ string packagePrefix = name.Length > 0 ? name + "." : "";
+ int nameLen = name.Length + 1;
+ aPath.ForeachFile((model) =>
{
- foreach (ClassModel type in model.Classes)
+ if (!model.HasPackage)
+ return true; // skip
+ string package = model.Package;
+ if (package == name)
{
- if (type.IndexType != null) continue;
- MemberModel item = type.ToMemberModel();
- if (type.Access == Visibility.Private)
+ var count = model.Classes.Count;
+ for (var i = 0; i < count; i++)
+ {
+ var type = model.Classes[i];
+ if (type.IndexType != null) continue;
+ if (type.Access != Visibility.Private)
+ pModel.Imports.Add(type.ToMemberModel());
+ }
+ count = model.Members.Count;
+ for (var i = 0; i < count; i++)
{
- item.Type = item.Name;
- item.Access = Visibility.Private;
+ pModel.Members.Add(model.Members[i].Clone());
}
- pModel.Imports.Add(item);
}
- foreach (MemberModel member in model.Members)
- pModel.Members.Add(member.Clone() as MemberModel);
- }
- else if (package != prevPackage
- && (package.Length > name.Length && package.StartsWith(packagePrefix))) // imports
- {
- prevPackage = package;
- if (nameLen > 1) package = package.Substring(nameLen);
- int p = package.IndexOf('.');
- if (p > 0) package = package.Substring(0, p);
- if (pModel.Imports.Search(package, 0, 0) == null) // sub packages
+ else if (package != prevPackage
+ && (package.Length > name.Length && package.StartsWithOrdinal(packagePrefix))) // imports
{
- pModel.Imports.Add(new MemberModel(package, package, FlagType.Package, Visibility.Public));
+ prevPackage = package;
+ if (nameLen > 1) package = package.Substring(nameLen);
+ int p = package.IndexOf('.');
+ if (p > 0) package = package.Substring(0, p);
+ if (!pModel.Imports.Contains(package)) // sub packages
+ {
+ pModel.Imports.Add(new MemberModel(package, package, FlagType.Package, Visibility.Public));
+ }
}
- }
- return true;
- });
+ return true;
+ });
+ }
}
- }
- // result
+ // result
if (pModel.Imports.Count > 0 || pModel.Members.Count > 0)
- {
+ {
pModel.Imports.Sort();
- return pModel;
- }
- else return null;
- }
+ return pModel;
+ }
+ return null;
+ }
- private void PopulateClassesEntries(string package, string path, MemberList memberList)
+ void PopulateClassesEntries(string package, string path, MemberList memberList)
{
string[] fileEntries = null;
try
{
- fileEntries = System.IO.Directory.GetFiles(path, "*" + settings.DefaultExtension);
+ fileEntries = Directory.GetFiles(path, "*" + settings.DefaultExtension);
}
catch { }
- if (fileEntries == null) return;
- string mname;
- string type;
- FlagType flag = FlagType.Class | ((package == null) ? FlagType.Intrinsic : 0);
+ if (fileEntries is null) return;
+ var flag = FlagType.Class | (package is null ? FlagType.Intrinsic : 0);
foreach (string entry in fileEntries)
{
- mname = GetLastStringToken(entry, dirSeparator);
- mname = mname.Substring(0, mname.LastIndexOf("."));
- if (mname.Length > 0 && memberList.Search(mname, 0, 0) == null && re_token.IsMatch(mname))
+ var mname = GetLastStringToken(entry, dirSeparator);
+ mname = mname.Substring(0, mname.LastIndexOf('.'));
+ if (mname.Length > 0 && !memberList.Contains(mname) && re_token.IsMatch(mname))
{
- type = mname;
+ var type = mname;
if (package.Length > 0) type = package + "." + mname;
memberList.Add(new MemberModel(mname, type, flag, Visibility.Public));
}
}
}
- private void PopulatePackageEntries(string package, string path, MemberList memberList)
+ static void PopulatePackageEntries(string package, string path, MemberList memberList)
{
string[] dirEntries = null;
try
{
- dirEntries = System.IO.Directory.GetDirectories(path);
+ dirEntries = Directory.GetDirectories(path);
}
catch { }
- if (dirEntries == null) return;
+ if (dirEntries is null) return;
- string mname;
- string type;
foreach (string entry in dirEntries)
{
- mname = GetLastStringToken(entry, dirSeparator);
- if (mname.Length > 0 && memberList.Search(mname, 0, 0) == null && re_token.IsMatch(mname))
+ var mname = GetLastStringToken(entry, dirSeparator);
+ if (mname.Length > 0 && !memberList.Contains(mname) && re_token.IsMatch(mname))
{
- type = mname;
+ var type = mname;
if (package.Length > 0) type = package + "." + mname;
memberList.Add(new MemberModel(mname, type, FlagType.Package, Visibility.Public));
}
@@ -1109,12 +1105,9 @@ private void PopulatePackageEntries(string package, string path, MemberList memb
///
public override MemberList GetTopLevelElements()
{
- if (topLevel != null)
- {
- if (topLevel.OutOfDate) InitTopLevelElements();
- return topLevel.Members;
- }
- else return new MemberList();
+ if (topLevel is null) return new MemberList();
+ if (topLevel.OutOfDate) InitTopLevelElements();
+ return topLevel.Members;
}
///
@@ -1122,88 +1115,79 @@ public override MemberList GetTopLevelElements()
///
///
public override MemberList GetVisibleExternalElements()
- {
+ {
if (!IsFileValid) return new MemberList();
-
- if (completionCache.IsDirty)
+ if (!completionCache.IsDirty) return completionCache.Elements;
+ var elements = new MemberList();
+ // root types & packages
+ var baseElements = ResolvePackage(null, false);
+ if (baseElements != null)
{
- MemberList elements = new MemberList();
- // root types & packages
- FileModel baseElements = ResolvePackage(null, false);
- if (baseElements != null)
- {
- elements.Add(baseElements.Imports);
- elements.Add(baseElements.Members);
- }
- elements.Add(new MemberModel(features.voidKey, features.voidKey, FlagType.Class | FlagType.Intrinsic, 0));
+ elements.Add(baseElements.Imports);
+ elements.Add(baseElements.Members);
+ }
+ elements.Add(new MemberModel(features.voidKey, features.voidKey, FlagType.Class | FlagType.Intrinsic, 0));
- //bool qualify = Settings.CompletionShowQualifiedTypes && settings.GenerateImports;
-
- // other classes in same package
- if (features.hasPackages && cFile.Package != "")
+ // other classes in same package
+ if (features.hasPackages && cFile.Package != "")
+ {
+ var packageElements = ResolvePackage(cFile.Package, false);
+ if (packageElements != null)
{
- FileModel packageElements = ResolvePackage(cFile.Package, false);
- if (packageElements != null)
+ foreach (var member in packageElements.Imports)
{
- foreach (MemberModel member in packageElements.Imports)
+ if (member.Flags != FlagType.Package)
{
- if (member.Flags != FlagType.Package)
- {
- //if (qualify) member.Name = member.Type;
- elements.Add(member);
- }
- }
- foreach (MemberModel member in packageElements.Members)
- {
- string pkg = member.InFile.Package;
- //if (qualify && pkg != "") member.Name = pkg + "." + member.Name;
- member.Type = pkg != "" ? pkg + "." + member.Name : member.Name;
elements.Add(member);
}
}
+ foreach (var member in packageElements.Members)
+ {
+ var pkg = member.InFile.Package;
+ member.Type = pkg != "" ? pkg + "." + member.Name : member.Name;
+ elements.Add(member);
+ }
}
- // other classes in same file
- if (cFile.PrivateSectionIndex > 0)
+ }
+ // other classes in same file
+ if (cFile.PrivateSectionIndex > 0)
+ {
+ if (inPrivateSection && cFile.Classes.Count > 1)
{
- if (inPrivateSection && cFile.Classes.Count > 1)
+ var mainClass = cFile.GetPublicClass();
+ if (!mainClass.IsVoid())
{
- ClassModel mainClass = cFile.GetPublicClass();
- if (!mainClass.IsVoid())
- {
- MemberModel toRemove = elements.Search(mainClass.Name, 0, 0);
- if (toRemove != null && toRemove.Type == mainClass.QualifiedName)
- elements.Remove(toRemove);
- }
+ var toRemove = elements.Search(mainClass.Name);
+ if (toRemove != null && toRemove.Type == mainClass.QualifiedName)
+ elements.Remove(toRemove);
}
+ }
- MemberModel member;
- foreach (ClassModel aClass in cFile.Classes)
+ foreach (var aClass in cFile.Classes)
+ {
+ if (features.hasMultipleDefs || aClass.Access == Visibility.Private)
{
- if (features.hasMultipleDefs || aClass.Access == Visibility.Private)
- {
- member = aClass.ToMemberModel();
- elements.Add(member);
- }
+ elements.Add(aClass.ToMemberModel());
}
}
+ }
- // imports
- elements.Add(ResolveImports(CurrentModel));
+ // imports
+ elements.Add(ResolveImports(CurrentModel));
- // in cache
- elements.Sort();
- completionCache = new CompletionCache(this, elements);
+ // in cache
+ elements.Sort();
+ completionCache = new CompletionCache(this, elements);
- // known classes colorization
- if (!CommonSettings.DisableKnownTypesColoring && !settings.LazyClasspathExploration && CurSciControl != null)
+ // known classes colorization
+ if (!CommonSettings.DisableKnownTypesColoring && !settings.LazyClasspathExploration && PluginBase.MainForm.CurrentDocument?.SciControl is { } sci)
+ {
+ try
{
- try
- {
- CurSciControl.KeyWords(1, completionCache.Keywords); // additional-keywords index = 1
- CurSciControl.Colourise(0, -1); // re-colorize the editor
- }
- catch (AccessViolationException){} // catch memory errors
- }
+ sci.KeyWords(1, completionCache.Keywords); // additional-keywords index = 1
+ sci.Colourise(0, -1); // re-colorize the editor
+ }
+ catch (AccessViolationException){} // catch memory errors
}
return completionCache.Elements;
}
@@ -1218,56 +1202,50 @@ public override MemberList GetAllProjectClasses()
if (!completionCache.IsDirty && completionCache.AllTypes != null)
return completionCache.AllTypes;
- MemberList fullList = new MemberList();
- ClassModel aClass;
- MemberModel item;
+ var result = new MemberList();
// public classes
- foreach (PathModel aPath in classPath) if (aPath.IsValid && !aPath.Updating)
- {
- aPath.ForeachFile((aFile) =>
+ foreach (var aPath in classPath)
+ if (aPath.IsValid && !aPath.Updating)
{
- aClass = aFile.GetPublicClass();
- if (!aClass.IsVoid() && aClass.IndexType == null && aClass.Access == Visibility.Public)
+ aPath.ForeachFile(aFile =>
{
- item = aClass.ToMemberModel();
- item.Name = item.Type;
- fullList.Add(item);
- }
- return true;
- });
- }
+ var aClass = aFile.GetPublicClass();
+ if (!aClass.IsVoid() && aClass.IndexType is null && aClass.Access == Visibility.Public)
+ {
+ var item = aClass.ToMemberModel();
+ item.Name = item.Type;
+ result.Add(item);
+ }
+ return true;
+ });
+ }
// void
- fullList.Add(new MemberModel(features.voidKey, features.voidKey, FlagType.Class | FlagType.Intrinsic, 0));
+ result.Add(new MemberModel(features.voidKey, features.voidKey, FlagType.Class | FlagType.Intrinsic, 0));
// in cache
- fullList.Sort();
- completionCache.AllTypes = fullList;
- return fullList;
+ result.Sort();
+ completionCache.AllTypes = result;
+ return result;
}
- #endregion
-
- #region command line compiler
- override public bool CanBuild
- {
- get { return cFile != null && cFile != FileModel.Ignore; }
- }
+ public override string GetDefaultValue(string type) => "undefined";
+ #endregion
+
+ #region command line compiler
+
+ public override bool CanBuild => cFile != null && cFile != FileModel.Ignore;
///
/// Retrieve the context's default compiler path
///
- public override string GetCompilerPath()
- {
- if (as2settings != null) return as2settings.GetDefaultSDK().Path;
- else return null;
- }
+ public override string GetCompilerPath() => as2settings?.GetDefaultSDK().Path;
///
/// Check current file's syntax
///
public override void CheckSyntax()
{
- if (as2settings == null)
+ if (as2settings is null)
{
ErrorManager.ShowInfo(TextHelper.GetString("Info.FeatureMissing"));
return;
@@ -1276,111 +1254,102 @@ public override void CheckSyntax()
RunCMD(as2settings.MtascCheckParameters);
}
- ///
- /// Run MTASC compiler in the current class's base folder with current classpath
- ///
- /// Additional comiler switches
- public override void RunCMD(string append)
- {
- if (as2settings == null)
+ ///
+ /// Run MTASC compiler in the current class's base folder with current classpath
+ ///
+ /// Additional compiler switches
+ public override void RunCMD(string append)
+ {
+ if (as2settings is null)
{
ErrorManager.ShowInfo(TextHelper.GetString("Info.FeatureMissing"));
return;
}
- if (!IsFileValid || !File.Exists(CurrentFile))
- return;
+ if (!IsFileValid || !File.Exists(CurrentFile)) return;
if (CurrentModel.Version != 2)
{
MessageBar.ShowWarning(TextHelper.GetString("Info.InvalidClass"));
return;
}
- string mtascPath = PluginBase.CurrentProject != null
- ? PluginBase.CurrentProject.CurrentSDK
- : PathHelper.ResolvePath(as2settings.GetDefaultSDK().Path);
+ var mtascPath = PluginBase.CurrentProject != null
+ ? PluginBase.CurrentProject.CurrentSDK
+ : PathHelper.ResolvePath(as2settings.GetDefaultSDK().Path);
if (!Directory.Exists(mtascPath) && !File.Exists(mtascPath))
- {
+ {
ErrorManager.ShowInfo(TextHelper.GetString("Info.InvalidMtascPath"));
- return;
- }
-
- SetStatusText(settings.CheckSyntaxRunning);
-
- try
- {
- // save modified files if needed
- if (outputFile != null) MainForm.CallCommand("SaveAllModified", null);
- else MainForm.CallCommand("SaveAllModified", ".as");
-
- // prepare command
+ return;
+ }
+
+ SetStatusText(settings.CheckSyntaxRunning);
+
+ try
+ {
+ // save modified files if needed
+ PluginBase.MainForm.CallCommand("SaveAllModified", outputFile != null ? null : ".as");
+
+ // prepare command
string command = mtascPath;
if (Path.GetExtension(command) == "") command = Path.Combine(command, "mtasc.exe");
else mtascPath = Path.GetDirectoryName(mtascPath);
command += ";\"" + CurrentFile + "\"";
- if (append == null || append.IndexOf("-swf-version") < 0)
- command += " -version "+majorVersion;
- // classpathes
- foreach(PathModel aPath in classPath)
- if (aPath.Path != temporaryPath
- && !aPath.Path.StartsWith(mtascPath, StringComparison.OrdinalIgnoreCase))
- command += " -cp \"" + aPath.Path.TrimEnd('\\') + "\"";
-
- // run
- string filePath = NormalizePath(cFile.BasePath);
- if (PluginBase.CurrentProject != null)
- filePath = Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath);
- string workDir = MainForm.WorkingDirectory;
- MainForm.WorkingDirectory = filePath;
- MainForm.CallCommand("RunProcessCaptured", command+" "+append);
- MainForm.WorkingDirectory = workDir;
- }
- catch (Exception ex)
- {
+ if (append is null || !append.Contains("-swf-version")) command += " -version "+majorVersion;
+ // classpathes
+ foreach(var aPath in classPath)
+ if (aPath.Path != temporaryPath
+ && !aPath.Path.StartsWith(mtascPath, StringComparison.OrdinalIgnoreCase))
+ command += " -cp \"" + aPath.Path.TrimEnd('\\') + "\"";
+
+ // run
+ var filePath = NormalizePath(cFile.BasePath);
+ if (PluginBase.CurrentProject != null) filePath = Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath);
+ var workDir = PluginBase.MainForm.WorkingDirectory;
+ PluginBase.MainForm.WorkingDirectory = filePath;
+ PluginBase.MainForm.CallCommand("RunProcessCaptured", command+" "+append);
+ PluginBase.MainForm.WorkingDirectory = workDir;
+ }
+ catch (Exception ex)
+ {
ErrorManager.ShowError(ex);
- }
- }
-
- ///
- /// Calls RunCMD with additional parameters taken from the classes @mtasc doc tag
- ///
- public override bool BuildCMD(bool failSilently)
- {
- if (as2settings == null)
+ }
+ }
+
+ ///
+ /// Calls RunCMD with additional parameters taken from the classes @mtasc doc tag
+ ///
+ public override bool BuildCMD(bool failSilently)
+ {
+ if (as2settings is null)
{
ErrorManager.ShowInfo(TextHelper.GetString("Info.FeatureMissing"));
return false;
}
- if (!File.Exists(CurrentFile))
- return false;
- // check if @mtasc is defined
- Match mCmd = null;
- ClassModel cClass = cFile.GetPublicClass();
+ if (!File.Exists(CurrentFile)) return false;
+ // check if @mtasc is defined
+ Match mCmd = null;
+ var cClass = cFile.GetPublicClass();
if (IsFileValid && cClass.Comments != null)
mCmd = re_CMD_BuildCommand.Match(cClass.Comments);
-
- if (CurrentModel.Version != 2 || mCmd == null || !mCmd.Success)
- {
- if (!failSilently)
- {
- MessageBar.ShowWarning(TextHelper.GetString("Info.InvalidForQuickBuild"));
- }
- return false;
- }
-
- // build command
- string command = mCmd.Groups["params"].Value.Trim();
+
+ if (CurrentModel.Version != 2 || mCmd is null || !mCmd.Success)
+ {
+ if (!failSilently) MessageBar.ShowWarning(TextHelper.GetString("Info.InvalidForQuickBuild"));
+ return false;
+ }
+
+ // build command
+ string command = mCmd.Groups["params"].Value.Trim();
try
{
command = Regex.Replace(command, "[\\r\\n]\\s*\\*", "", RegexOptions.Singleline);
- command = " " + MainForm.ProcessArgString(command) + " ";
- if (command == null || command.Length == 0)
+ command = " " + PluginBase.MainForm.ProcessArgString(command) + " ";
+ if (string.IsNullOrEmpty(command))
{
- if (!failSilently)
- throw new Exception(TextHelper.GetString("Info.InvalidQuickBuildCommand"));
+ if (!failSilently) throw new Exception(TextHelper.GetString("Info.InvalidQuickBuildCommand"));
return false;
}
outputFile = null;
@@ -1388,18 +1357,17 @@ public override bool BuildCMD(bool failSilently)
trustFileWanted = false;
// get SWF url
- MatchCollection mPar = re_SplitParams.Matches(command + "-eof");
- int mPlayIndex = -1;
- bool noPlay = false;
+ var mPar = re_SplitParams.Matches(command + "-eof");
+ var mPlayIndex = -1;
+ var noPlay = false;
if (mPar.Count > 0)
{
- string op;
for (int i = 0; i < mPar.Count; i++)
{
- op = mPar[i].Groups["switch"].Value;
+ var op = mPar[i].Groups["switch"].Value;
int start = mPar[i].Index + mPar[i].Length;
int end = (mPar.Count > i + 1) ? mPar[i + 1].Index : start;
- if ((op == "-swf") && (outputFile == null) && (mPlayIndex < 0))
+ if ((op == "-swf") && (outputFile is null) && (mPlayIndex < 0))
{
if (end > start)
outputFile = command.Substring(start, end - start).Trim();
@@ -1435,24 +1403,21 @@ public override bool BuildCMD(bool failSilently)
}
}
}
- if (outputFile.Length == 0) outputFile = null;
+ if (outputFile.IsNullOrEmpty()) outputFile = null;
// cleaning custom switches
if (mPlayIndex >= 0)
{
command = command.Substring(0, mPar[mPlayIndex].Index) + command.Substring(mPar[mPlayIndex + 1].Index);
}
- if (trustFileWanted)
- {
- command = command.Replace("-trust", "");
- }
+ if (trustFileWanted) command = command.Replace("-trust", "");
if (noPlay || !settings.PlayAfterBuild)
{
command = command.Replace("-noplay", "");
outputFile = null;
runAfterBuild = false;
}
- else runAfterBuild = (outputFile != null);
+ else runAfterBuild = outputFile != null;
// fixing output path
if (runAfterBuild)
@@ -1474,11 +1439,11 @@ public override bool BuildCMD(bool failSilently)
ErrorManager.ShowError(ex);
return false;
}
-
- // run
- RunCMD(command);
- return true;
- }
+
+ // run
+ RunCMD(command);
+ return true;
+ }
#endregion
- }
-}
+ }
+}
\ No newline at end of file
diff --git a/External/Plugins/AS2Context/PluginMain.cs b/External/Plugins/AS2Context/PluginMain.cs
index b0db561799..0e600c71a2 100644
--- a/External/Plugins/AS2Context/PluginMain.cs
+++ b/External/Plugins/AS2Context/PluginMain.cs
@@ -1,113 +1,85 @@
using System;
-using System.IO;
+using System.Collections.Generic;
using System.ComponentModel;
-using WeifenLuo.WinFormsUI;
+using System.Globalization;
+using System.IO;
+using System.Text.RegularExpressions;
+using ASCompletion.Context;
+using PluginCore;
+using PluginCore.Helpers;
using PluginCore.Localization;
using PluginCore.Managers;
using PluginCore.Utilities;
-using PluginCore.Helpers;
-using PluginCore;
-using System.Text.RegularExpressions;
-using System.Collections.Generic;
namespace AS2Context
{
public class PluginMain : IPlugin, InstalledSDKOwner
{
- private String pluginName = "AS2Context";
- private String pluginGuid = "1f387fab-421b-42ac-a985-72a03534f731";
- private String pluginHelp = "www.flashdevelop.org/community/";
- private String pluginDesc = "ActionScript 2 context for the ASCompletion engine.";
- private String pluginAuth = "FlashDevelop Team";
- private AS2Settings settingObject;
- private Context contextInstance;
- private String settingFilename;
+ AS2Settings settingObject;
+ Context contextInstance;
+ string settingFilename;
#region Required Properties
///
/// Api level of the plugin
///
- public Int32 Api
- {
- get { return 1; }
- }
+ public int Api => 1;
///
/// Name of the plugin
///
- public String Name
- {
- get { return this.pluginName; }
- }
+ public string Name { get; } = nameof(AS2Context);
///
/// GUID of the plugin
///
- public String Guid
- {
- get { return this.pluginGuid; }
- }
+ public string Guid { get; } = "1f387fab-421b-42ac-a985-72a03534f731";
///
/// Author of the plugin
///
- public String Author
- {
- get { return this.pluginAuth; }
- }
+ public string Author { get; } = "FlashDevelop Team";
///
/// Description of the plugin
///
- public String Description
- {
- get { return this.pluginDesc; }
- }
+ public string Description { get; set; } = "ActionScript 2 context for the ASCompletion engine.";
///
/// Web address for help
///
- public String Help
- {
- get { return this.pluginHelp; }
- }
+ public string Help { get; } = "https://www.flashdevelop.org/community/";
///
/// Object that contains the settings
///
[Browsable(false)]
- public Object Settings
- {
- get { return this.settingObject; }
- }
+ public object Settings => settingObject;
#endregion
#region Required Methods
///
- /// Initializes the plugin
- ///
+ /// Initializes the plugin
+ ///
public void Initialize()
{
- this.InitBasics();
- this.LoadSettings();
- this.AddEventHandlers();
+ InitBasics();
+ LoadSettings();
+ AddEventHandlers();
}
///
/// Disposes the plugin
///
- public void Dispose()
- {
- this.SaveSettings();
- }
+ public void Dispose() => SaveSettings();
///
/// Handles the incoming events
///
- public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
+ public void HandleEvent(object sender, NotifyEvent e, HandlingPriority priority)
{
switch (e.Type)
{
@@ -115,7 +87,7 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
contextInstance = new Context(settingObject);
ValidateSettings();
// Associate this context with AS2 language
- ASCompletion.Context.ASContext.RegisterLanguage(contextInstance, "as2");
+ ASContext.RegisterLanguage(contextInstance, "as2");
break;
}
}
@@ -129,93 +101,81 @@ public void HandleEvent(Object sender, NotifyEvent e, HandlingPriority prority)
///
public void InitBasics()
{
- String dataPath = Path.Combine(PathHelper.DataDir, "AS2Context");
- if (!Directory.Exists(dataPath)) Directory.CreateDirectory(dataPath);
- this.settingFilename = Path.Combine(dataPath, "Settings.fdb");
- this.pluginDesc = TextHelper.GetString("Info.Description");
+ var path = Path.Combine(PathHelper.DataDir, nameof(AS2Context));
+ if (!Directory.Exists(path)) Directory.CreateDirectory(path);
+ settingFilename = Path.Combine(path, "Settings.fdb");
+ Description = TextHelper.GetString("Info.Description");
}
///
/// Adds the required event handlers
///
- public void AddEventHandlers()
- {
- EventManager.AddEventHandler(this, EventType.UIStarted);
- }
+ public void AddEventHandlers() => EventManager.AddEventHandler(this, EventType.UIStarted);
///
/// Loads the plugin settings
///
public void LoadSettings()
{
- this.settingObject = new AS2Settings();
- if (!File.Exists(this.settingFilename)) this.SaveSettings();
+ settingObject = new AS2Settings();
+ if (!File.Exists(settingFilename)) SaveSettings();
else
{
- Object obj = ObjectSerializer.Deserialize(this.settingFilename, this.settingObject);
- this.settingObject = (AS2Settings)obj;
+ settingObject = ObjectSerializer.Deserialize(settingFilename, settingObject);
if (settingObject.InstalledSDKs != null)
- foreach (InstalledSDK sdk in settingObject.InstalledSDKs)
+ foreach (var sdk in settingObject.InstalledSDKs)
sdk.Owner = this;
}
- if (this.settingObject.MMClassPath == null) this.settingObject.MMClassPath = FindMMClassPath();
- if (this.settingObject.UserClasspath == null)
- {
- if (this.settingObject.MMClassPath != null) this.settingObject.UserClasspath = new String[] { this.settingObject.MMClassPath };
- else this.settingObject.UserClasspath = new String[] {};
- }
+ settingObject.MMClassPath ??= FindMMClassPath();
+ settingObject.UserClasspath ??= settingObject.MMClassPath != null
+ ? new[] {settingObject.MMClassPath}
+ : Array.Empty();
}
///
/// Fix some settings values when the context has been created
///
- private void ValidateSettings()
+ void ValidateSettings()
{
- if (settingObject.InstalledSDKs == null || settingObject.InstalledSDKs.Length == 0)
+ if (settingObject.InstalledSDKs.IsNullOrEmpty())
{
- List allSdks = new List();
- string includedSDK = "Tools\\mtasc";
+ var allSdks = new List();
+ var includedSDK = "Tools\\mtasc";
if (Directory.Exists(PathHelper.ResolvePath(includedSDK)))
{
- InstalledSDK sdk = new InstalledSDK(this);
- sdk.Path = includedSDK;
- allSdks.Add(sdk);
+ allSdks.Add(new InstalledSDK(this) {Path = includedSDK});
}
- string appManDir = Path.Combine(PathHelper.BaseDir, @"Data\AppMan\Archive\mtasc");
+ var appManDir = Path.Combine(PathHelper.BaseDir, @"Data\AppMan\Archive\mtasc");
if (Directory.Exists(appManDir))
{
- string[] versionDirs = Directory.GetDirectories(appManDir);
- foreach (string versionDir in versionDirs)
+ var versionDirs = Directory.GetDirectories(appManDir);
+ foreach (var versionDir in versionDirs)
{
- if (Directory.Exists(versionDir))
- {
- InstalledSDK sdk = new InstalledSDK(this);
- sdk.Path = versionDir;
- allSdks.Add(sdk);
- }
+ if (!Directory.Exists(versionDir)) continue;
+ allSdks.Add(new InstalledSDK(this) {Path = versionDir});
}
}
settingObject.InstalledSDKs = allSdks.ToArray();
}
- else foreach (InstalledSDK sdk in settingObject.InstalledSDKs) ValidateSDK(sdk);
+ else
+ {
+ foreach (InstalledSDK sdk in settingObject.InstalledSDKs)
+ {
+ sdk.Validate();
+ }
+ }
settingObject.OnClasspathChanged += SettingObjectOnClasspathChanged;
}
///
/// Update the classpath if an important setting has changed
///
- private void SettingObjectOnClasspathChanged()
- {
- if (contextInstance != null) contextInstance.BuildClassPath();
- }
+ void SettingObjectOnClasspathChanged() => contextInstance?.BuildClassPath();
///
/// Saves the plugin settings
///
- public void SaveSettings()
- {
- ObjectSerializer.Serialize(this.settingFilename, this.settingObject);
- }
+ public void SaveSettings() => ObjectSerializer.Serialize(settingFilename, settingObject);
#endregion
@@ -225,16 +185,15 @@ public bool ValidateSDK(InstalledSDK sdk)
{
sdk.Owner = this;
- IProject project = PluginBase.CurrentProject;
- string path = sdk.Path;
- if (project != null)
- path = PathHelper.ResolvePath(path, Path.GetDirectoryName(project.ProjectPath));
- else
- path = PathHelper.ResolvePath(path);
+ var project = PluginBase.CurrentProject;
+ var path = sdk.Path;
+ path = project != null
+ ? PathHelper.ResolvePath(path, Path.GetDirectoryName(project.ProjectPath))
+ : PathHelper.ResolvePath(path);
try
{
- if (path == null || (!Directory.Exists(path) && !File.Exists(path)))
+ if (!Directory.Exists(path) && !File.Exists(path))
{
ErrorManager.ShowInfo("Path not found:\n" + sdk.Path);
return false;
@@ -247,18 +206,18 @@ public bool ValidateSDK(InstalledSDK sdk)
}
if (!Directory.Exists(path)) path = Path.GetDirectoryName(path);
- string descriptor = Path.Combine(path, "changes.txt");
+ var descriptor = Path.Combine(path, "changes.txt");
if (File.Exists(descriptor))
{
- string raw = File.ReadAllText(descriptor);
- Match mVer = Regex.Match(raw, "[0-9\\-]+\\s*:\\s*([0-9.]+)");
+ var text = File.ReadAllText(descriptor);
+ var mVer = Regex.Match(text, "[0-9\\-]+\\s*:\\s*([0-9.]+)");
if (mVer.Success)
{
sdk.Version = mVer.Groups[1].Value;
- sdk.Name = "MTASC " + sdk.Version;
+ sdk.Name = $"MTASC {sdk.Version}";
return true;
}
- else ErrorManager.ShowInfo("Invalid changes.txt file:\n" + descriptor);
+ ErrorManager.ShowInfo("Invalid changes.txt file:\n" + descriptor);
}
else ErrorManager.ShowInfo("No changes.txt found:\n" + descriptor);
return false;
@@ -269,21 +228,21 @@ public bool ValidateSDK(InstalledSDK sdk)
#region Macromedia/Adobe Flash IDE
// locations in Application Data
- static readonly private string[] MACROMEDIA_VERSIONS = {
+ static readonly string[] MACROMEDIA_VERSIONS = {
"\\Adobe\\Flash CS5\\",
"\\Adobe\\Flash CS4\\",
- "\\Adobe\\Flash CS3\\",
- "\\Macromedia\\Flash 8\\",
- "\\Macromedia\\Flash MX 2004\\"
- };
+ "\\Adobe\\Flash CS3\\",
+ "\\Macromedia\\Flash 8\\",
+ "\\Macromedia\\Flash MX 2004\\"
+ };
///
/// Explore the possible locations for the Macromedia Flash IDE classpath
///
- static private string FindMMClassPath()
+ static string FindMMClassPath()
{
bool found = false;
- string deflang = System.Globalization.CultureInfo.CurrentUICulture.Name;
+ string deflang = CultureInfo.CurrentUICulture.Name;
deflang = deflang.Substring(0, 2);
string localAppData = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
string cp = "";
@@ -291,18 +250,18 @@ static private string FindMMClassPath()
{
cp = localAppData + path;
// default language
- if (System.IO.Directory.Exists(cp + deflang + "\\Configuration\\Classes\\"))
+ if (Directory.Exists(cp + deflang + "\\Configuration\\Classes\\"))
{
cp += deflang + "\\Configuration\\Classes\\";
found = true;
}
// look for other languages
- else if (System.IO.Directory.Exists(cp))
+ else if (Directory.Exists(cp))
{
- string[] dirs = System.IO.Directory.GetDirectories(cp);
+ var dirs = Directory.GetDirectories(cp);
foreach (string dir in dirs)
{
- if (System.IO.Directory.Exists(dir + "\\Configuration\\Classes\\"))
+ if (Directory.Exists(dir + "\\Configuration\\Classes\\"))
{
cp = dir + "\\Configuration\\Classes\\";
found = true;
@@ -312,12 +271,8 @@ static private string FindMMClassPath()
}
if (found) break;
}
- if (found) return cp;
- else return null;
+ return found ? cp : null;
}
#endregion
-
}
-
-}
-
+}
\ No newline at end of file
diff --git a/External/Plugins/AS2Context/Properties/AssemblyInfo.cs b/External/Plugins/AS2Context/Properties/AssemblyInfo.cs
index e5fc0942da..1bef6c04ea 100644
--- a/External/Plugins/AS2Context/Properties/AssemblyInfo.cs
+++ b/External/Plugins/AS2Context/Properties/AssemblyInfo.cs
@@ -1,15 +1,14 @@
using System.Reflection;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
+using PluginCore;
// Information about this assembly is defined by the following attributes.
// Change them to the information which is associated with the assembly you compile.
[assembly: AssemblyTitle("AS2Context")]
-[assembly: AssemblyDescription("AS2Context Plugin For ASCompletion In FlashDevelop.")]
+[assembly: AssemblyDescription("AS2 Context Plugin For ASCompletion In " + DistroConfig.DISTRIBUTION_NAME)]
[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("FlashDevelop.org")]
+[assembly: AssemblyCompany(DistroConfig.DISTRIBUTION_COMPANY)]
[assembly: AssemblyProduct("AS2Context")]
-[assembly: AssemblyCopyright("FlashDevelop.org 2005-2014")]
+[assembly: AssemblyCopyright(DistroConfig.DISTRIBUTION_COPYRIGHT)]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: AssemblyVersion("1.0.0.0")]
diff --git a/External/Plugins/AS3Context/AS3Context.csproj b/External/Plugins/AS3Context/AS3Context.csproj
index f77a5ad124..f73ae9a4b6 100644
--- a/External/Plugins/AS3Context/AS3Context.csproj
+++ b/External/Plugins/AS3Context/AS3Context.csproj
@@ -1,182 +1,146 @@
-
-
- Debug
- AnyCPU
- 9.0.30729
- 2.0
- {0263E5F6-D5B2-4118-B12E-87F9A74DE8AF}
- Library
- Properties
- AS3Context
- AS3Context
-
-
-
-
- 3.5
-
-
- v2.0
-
- publish\
- true
- Disk
- false
- Foreground
- 7
- Days
- false
- false
- true
- 0
- 1.0.0.%2a
- false
- false
- true
-
-
- true
- full
- false
- ..\..\..\FlashDevelop\Bin\Debug\Plugins\
- DEBUG;TRACE
- prompt
- 4
-
-
- pdbonly
- true
- ..\..\..\FlashDevelop\Bin\Debug\Plugins\
- TRACE
- prompt
- 4
-
-
- x86
- ..\..\..\FlashDevelop\Bin\Debug\Plugins\
-
-
- x86
- ..\..\..\FlashDevelop\Bin\Debug\Plugins\
- TRACE
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
- Component
-
-
-
-
- UserControl
-
-
- ProfilerUI.cs
-
-
- Component
-
-
- Component
-
-
-
-
-
-
-
-
- False
- ..\..\..\FlashDevelop\Bin\Debug\Aga.dll
- False
-
-
- False
- ..\..\..\FlashDevelop\Bin\Debug\SwfOp.dll
- False
-
-
-
-
-
-
-
-
-
-
-
- {61885F70-B4DC-4B44-852D-5D6D03F2A734}
- PluginCore
- False
-
-
- {74AD0487-CEF9-43FE-9283-BC6F79539ADE}
- AS2Context
- False
-
-
- {4EBF2653-9654-4E40-880E-0046B3D6210E}
- ASCompletion
- False
-
-
- {D6AAF434-F4DF-4376-863D-109A8762CECA}
- FlashConnect
- False
-
-
- {78101C01-E186-4954-B1DD-DEBB7905FAD8}
- ProjectManager
- False
-
-
- {556F43A0-C288-471A-8CD8-A787FC7ACA34}
- XMLCompletion
-
-
-
-
-
-
-
-
-
-
- False
- Microsoft .NET Framework 4 %28x86 and x64%29
- true
-
-
- False
- .NET Framework 3.5 SP1 Client Profile
- false
-
-
- False
- .NET Framework 3.5 SP1
- false
-
-
- False
- Windows Installer 3.1
- true
-
-
+
+
+
+ Debug
+ AnyCPU
+ {0263E5F6-D5B2-4118-B12E-87F9A74DE8AF}
+ Library
+ Properties
+ AS3Context
+ AS3Context
+ net48
+ true
+ false
+ false
+ false
+ false
+ x64;x86;AnyCPU
+
+
+ true
+ full
+ false
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ DEBUG;TRACE
+ prompt
+ 4
+ 9
+
+
+ none
+ true
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ TRACE
+ prompt
+ 4
+ 9
+
+
+ x86
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ DEBUG;TRACE
+ 9
+
+
+ x86
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ TRACE
+ true
+ 9
+
+
+ true
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ DEBUG;TRACE
+ full
+ x64
+ 9
+ prompt
+
+
+ ..\..\..\FlashDevelop\Bin\Debug\Plugins\
+ TRACE
+ true
+ x64
+ 9
+ prompt
+
+
+
+
+
+
+
+
+
+
+
+
+
+ UserControl
+
+
+ ProfilerUI.cs
+
+
+ Component
+
+
+
+
+
+
+
+
+ False
+ ..\..\..\FlashDevelop\Bin\Debug\Aga.dll
+ False
+
+
+ False
+ ..\..\..\FlashDevelop\Bin\Debug\SwfOp.dll
+ False
+
+
+
+
+
+
+
+
+ {61885F70-B4DC-4B44-852D-5D6D03F2A734}
+ PluginCore
+ False
+
+
+ {74AD0487-CEF9-43FE-9283-BC6F79539ADE}
+ AS2Context
+ False
+
+
+ {4EBF2653-9654-4E40-880E-0046B3D6210E}
+ ASCompletion
+ False
+
+
+ {D6AAF434-F4DF-4376-863D-109A8762CECA}
+ FlashConnect
+ False
+
+
+ {78101C01-E186-4954-B1DD-DEBB7905FAD8}
+ ProjectManager
+ False
+
+
+ {556F43A0-C288-471A-8CD8-A787FC7ACA34}
+ XMLCompletion
+ False
+
+
+
+
+
+
\ No newline at end of file
diff --git a/External/Plugins/AS3Context/AS3Settings.cs b/External/Plugins/AS3Context/AS3Settings.cs
index 9adbfe099c..8324303e08 100644
--- a/External/Plugins/AS3Context/AS3Settings.cs
+++ b/External/Plugins/AS3Context/AS3Settings.cs
@@ -1,12 +1,10 @@
using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Drawing.Design;
-using System.Windows.Forms.Design;
using System.ComponentModel;
-using PluginCore.Localization;
+using System.Drawing.Design;
+using ASCompletion.Settings;
+using Ookii.Dialogs;
using PluginCore;
-using System.IO;
+using PluginCore.Localization;
namespace AS3Context
{
@@ -14,7 +12,7 @@ namespace AS3Context
public delegate void InstalledSDKsChangedEvent();
[Serializable]
- public class AS3Settings : ASCompletion.Settings.IContextSettings
+ public class AS3Settings : IContextSettings
{
[field: NonSerialized]
public event ClasspathChangedEvent OnClasspathChanged;
@@ -33,8 +31,8 @@ public class AS3Settings : ASCompletion.Settings.IContextSettings
[LocalizedCategory("ASCompletion.Category.Documentation"), LocalizedDescription("ASCompletion.Description.DocumentationCommandLine"), DefaultValue(DEFAULT_DOC_COMMAND)]
public string DocumentationCommandLine
{
- get { return documentationCommandLine; }
- set { documentationCommandLine = value; }
+ get => documentationCommandLine;
+ set => documentationCommandLine = value;
}
#endregion
@@ -59,46 +57,34 @@ public string DocumentationCommandLine
protected bool generateImports = DEFAULT_GENERATEIMPORTS;
protected bool playAfterBuild = DEFAULT_PLAY;
protected bool fixPackageAutomatically = DEFAULT_FIXPACKAGEAUTOMATICALLY;
- protected string[] userClasspath = null;
- protected InstalledSDK[] installedSDKs = null;
+ protected string[] userClasspath;
+ protected InstalledSDK[] installedSDKs;
[Browsable(false)]
- public string LanguageId
- {
- get { return "AS3"; }
- }
+ public string LanguageId => "AS3";
[Browsable(false)]
- public string DefaultExtension
- {
- get { return ".as"; }
- }
+ public string DefaultExtension => ".as";
[Browsable(false)]
- public string CheckSyntaxRunning
- {
- get { return TextHelper.GetString("Info.MxmlcRunning"); }
- }
+ public string CheckSyntaxRunning => TextHelper.GetString("Info.MxmlcRunning");
[Browsable(false)]
- public string CheckSyntaxDone
- {
- get { return TextHelper.GetString("Info.MxmlcDone"); }
- }
+ public string CheckSyntaxDone => TextHelper.GetString("Info.MxmlcDone");
[DisplayName("Check Syntax On Save")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.CheckSyntaxOnSave"), DefaultValue(DEFAULT_CHECKSYNTAX)]
public bool CheckSyntaxOnSave
{
- get { return checkSyntaxOnSave; }
- set { checkSyntaxOnSave = value; }
+ get => checkSyntaxOnSave;
+ set => checkSyntaxOnSave = value;
}
[DisplayName("User Classpath")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.UserClasspath"), DefaultValue(DEFAULT_AS3LIBRARY)]
public string[] UserClasspath
{
- get { return userClasspath; }
+ get => userClasspath;
set
{
userClasspath = value;
@@ -110,20 +96,18 @@ public string[] UserClasspath
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("AS3Context.Description.FlexSDK")]
public InstalledSDK[] InstalledSDKs
{
- get { return installedSDKs; }
+ get => installedSDKs;
set
{
installedSDKs = value;
FireChanged();
- if (OnInstalledSDKsChanged != null) OnInstalledSDKsChanged();
+ OnInstalledSDKsChanged?.Invoke();
}
}
public InstalledSDK GetDefaultSDK()
{
- if (installedSDKs == null || installedSDKs.Length == 0)
- return InstalledSDK.INVALID_SDK;
-
+ if (installedSDKs.IsNullOrEmpty()) return InstalledSDK.INVALID_SDK;
foreach (InstalledSDK sdk in installedSDKs)
if (sdk.IsValid) return sdk;
return InstalledSDK.INVALID_SDK;
@@ -133,73 +117,73 @@ public InstalledSDK GetDefaultSDK()
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.CompletionEnabled"), DefaultValue(DEFAULT_COMPLETIONENABLED)]
public bool CompletionEnabled
{
- get { return completionEnabled; }
- set { completionEnabled = value; }
+ get => completionEnabled;
+ set => completionEnabled = value;
}
[DisplayName("Generate Imports")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.GenerateImports"), DefaultValue(DEFAULT_GENERATEIMPORTS)]
public bool GenerateImports
{
- get { return generateImports; }
- set { generateImports = value; }
+ get => generateImports;
+ set => generateImports = value;
}
[DisplayName("List All Types In Completion")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.CompletionListAllTypes"), DefaultValue(DEFAULT_LISTALL)]
public bool CompletionListAllTypes
{
- get { return completionListAllTypes; }
- set { completionListAllTypes = value; }
+ get => completionListAllTypes;
+ set => completionListAllTypes = value;
}
[DisplayName("Show Qualified Types In Completion")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.CompletionShowQualifiedTypes"), DefaultValue(DEFAULT_QUALIFY)]
public bool CompletionShowQualifiedTypes
{
- get { return completionShowQualifiedTypes; }
- set { completionShowQualifiedTypes = value; }
+ get => completionShowQualifiedTypes;
+ set => completionShowQualifiedTypes = value;
}
[DisplayName("Lazy Classpath Exploration")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.LazyClasspathExploration"), DefaultValue(DEFAULT_LAZYMODE)]
public bool LazyClasspathExploration
{
- get { return lazyClasspathExploration; }
- set { lazyClasspathExploration = value; }
+ get => lazyClasspathExploration;
+ set => lazyClasspathExploration = value;
}
[DisplayName("Play After Build")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.PlayAfterBuild"), DefaultValue(DEFAULT_PLAY)]
public bool PlayAfterBuild
{
- get { return playAfterBuild; }
- set { playAfterBuild = value; }
+ get => playAfterBuild;
+ set => playAfterBuild = value;
}
[DisplayName("Fix Package Automatically")]
[LocalizedCategory("ASCompletion.Category.Common"), LocalizedDescription("ASCompletion.Description.FixPackageAutomatically"), DefaultValue(DEFAULT_FIXPACKAGEAUTOMATICALLY)]
public bool FixPackageAutomatically
{
- get { return fixPackageAutomatically; }
- set { fixPackageAutomatically = value; }
+ get => fixPackageAutomatically;
+ set => fixPackageAutomatically = value;
}
#endregion
#region AS3 specific members
- const string DEFAULT_FLASHVERSION = "10.1";
+ const string DEFAULT_FLASHVERSION = "14.0";
- private string flashVersion = DEFAULT_FLASHVERSION;
- private string as3ClassPath;
- private string[] as3FileTypes;
+ string flashVersion = DEFAULT_FLASHVERSION;
+ string as3ClassPath;
+ string[] as3FileTypes;
[DisplayName("Default Flash Version")]
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("AS3Context.Description.DefaultFlashVersion"), DefaultValue(DEFAULT_FLASHVERSION)]
public string DefaultFlashVersion
{
- get { return flashVersion ?? DEFAULT_FLASHVERSION; }
+ get => flashVersion ?? DEFAULT_FLASHVERSION;
set
{
if (value == flashVersion) return;
@@ -210,10 +194,10 @@ public string DefaultFlashVersion
[DisplayName("AS3 Classpath")]
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("AS3Context.Description.AS3Classpath"), DefaultValue(DEFAULT_AS3LIBRARY)]
- [Editor(typeof(FolderNameEditor), typeof(UITypeEditor))]
+ [Editor(typeof(VistaFolderNameEditor), typeof(UITypeEditor))]
public string AS3ClassPath
{
- get { return as3ClassPath; }
+ get => as3ClassPath;
set
{
if (value == as3ClassPath) return;
@@ -226,7 +210,7 @@ public string AS3ClassPath
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("AS3Context.Description.AS3FileTypes")]
public string[] AS3FileTypes
{
- get { return as3FileTypes; }
+ get => as3FileTypes;
set
{
if (value == as3FileTypes) return;
@@ -239,23 +223,23 @@ public string[] AS3FileTypes
#region Profiler settings
const int DEFAULT_PROFILER_TIMEOUT = 30;
- private int profilerTimeout;
- private string[] customProfilers;
+ int profilerTimeout;
+ string[] customProfilers;
[DisplayName("Profiler Timeout")]
[LocalizedCategory("AS3Context.Category.Profiler"), LocalizedDescription("AS3Context.Description.ProfilerTimeout"), DefaultValue(DEFAULT_PROFILER_TIMEOUT)]
public int ProfilerTimeout
{
- get { return profilerTimeout; }
- set { profilerTimeout = Math.Max(5, value); }
+ get => profilerTimeout;
+ set => profilerTimeout = Math.Max(5, value);
}
[DisplayName("Custom Profilers")]
[LocalizedCategory("AS3Context.Category.Profiler"), LocalizedDescription("AS3Context.Description.CustomProfilers")]
public string[] CustomProfilers
{
- get { return customProfilers; }
- set { customProfilers = value; }
+ get => customProfilers;
+ set => customProfilers = value;
}
#endregion
@@ -265,39 +249,39 @@ public string[] CustomProfilers
const bool DEFAULT_VERBOSEFDB = false;
const bool DEFAULT_DISABLELIVECHECKING = false;
- private bool disableFDB;
- private bool verboseFDB;
- private bool disableLiveChecking;
+ bool disableFDB;
+ bool verboseFDB;
+ bool disableLiveChecking;
[DisplayName("Disable Flex Debugger Hosting")]
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("ASCompletion.Description.DisableFDB"), DefaultValue(DEFAULT_DISABLEFDB)]
public bool DisableFDB
{
- get { return disableFDB; }
- set { disableFDB = value; }
+ get => disableFDB;
+ set => disableFDB = value;
}
[DisplayName("Verbose Flex Debugger Output")]
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("ASCompletion.Description.VerboseFDB"), DefaultValue(DEFAULT_VERBOSEFDB)]
public bool VerboseFDB
{
- get { return verboseFDB; }
- set { verboseFDB = value; }
+ get => verboseFDB;
+ set => verboseFDB = value;
}
[DisplayName("Disable Live Syntax Checking")]
[LocalizedCategory("ASCompletion.Category.Language"), LocalizedDescription("ASCompletion.Description.DisableLiveSyntaxChecking"), DefaultValue(DEFAULT_DISABLELIVECHECKING)]
public bool DisableLiveChecking
{
- get { return disableLiveChecking; }
- set { disableLiveChecking = value; }
+ get => disableLiveChecking;
+ set => disableLiveChecking = value;
}
#endregion
- private void FireChanged()
- {
- if (OnClasspathChanged != null) OnClasspathChanged();
- }
+ void FireChanged() => OnClasspathChanged?.Invoke();
+
+ [Browsable(false)]
+ public string AddSpaceAfter { get; set; }
}
}
diff --git a/External/Plugins/AS3Context/AbcConverter.cs b/External/Plugins/AS3Context/AbcConverter.cs
index 324a69166e..fedca48311 100644
--- a/External/Plugins/AS3Context/AbcConverter.cs
+++ b/External/Plugins/AS3Context/AbcConverter.cs
@@ -2,76 +2,63 @@
using System.Collections.Generic;
using System.Globalization;
using System.IO;
+using System.Text;
using System.Text.RegularExpressions;
using System.Xml;
using ASCompletion.Context;
using ASCompletion.Model;
+using PluginCore;
using SwfOp;
using SwfOp.Data;
-
namespace AS3Context
{
#region AbcConverter class: ABC model builder
public class AbcConverter
{
- static public List ExcludedASDocs = getDefaultExcludedASDocs();
+ public static List ExcludedASDocs = new() {"helpid", "keyword"};
- static public Regex reSafeChars = new Regex("[*\\:" + Regex.Escape(new String(Path.GetInvalidPathChars())) + "]", RegexOptions.Compiled);
- static private Regex reDocFile = new Regex("[/\\\\]([-_.$a-z0-9]+)\\.xml", RegexOptions.IgnoreCase | RegexOptions.Compiled);
+ public static Regex reSafeChars = new Regex("[*\\:" + Regex.Escape(new string(Path.GetInvalidPathChars())) + "]", RegexOptions.Compiled);
+ static readonly Regex reDocFile = new Regex("[/\\\\]([-_.$a-z0-9]+)\\.xml", RegexOptions.IgnoreCase | RegexOptions.Compiled);
- static public Dictionary> Docs = new Dictionary>();
+ public static Dictionary> Docs = new Dictionary>();
- private static Dictionary genericTypes;
- private static Dictionary imports;
- private static Dictionary conflicts;
- private static bool inSWF;
- private static Dictionary thisDocs;
- private static string docPath;
-
- ///
- private static List getDefaultExcludedASDocs()
- {
- List list = new List();
- list.Add("helpid");
- list.Add("keyword");
- return list;
- }
+ static Dictionary genericTypes;
+ static Dictionary imports;
+ static Dictionary conflicts;
+ static bool inSWF;
+ static Dictionary thisDocs;
+ static string docPath;
///
/// Extract documentation from XML included in ASDocs-enriched SWCs
///
- ///
- private static void ParseDocumentation(ContentParser parser)
+ static void ParseDocumentation(ContentParser parser)
{
if (parser.Catalog != null)
{
- MxmlFilter.AddCatalog(parser.Filename, parser.Catalog);
+ MxmlFilter.AddCatalogs(parser.Filename, parser.Catalog);
}
if (parser.Docs.Count > 0)
foreach (string docFile in parser.Docs.Keys)
{
- if (docFile.EndsWith(".dita.xml"))
+ if (docFile.EndsWithOrdinal(".dita.xml"))
continue;
try
{
- Match m = reDocFile.Match(docFile);
+ var m = reDocFile.Match(docFile);
if (!m.Success) continue;
- string package = m.Groups[1].Value;
- Dictionary packageDocs = Docs.ContainsKey(package)
- ? Docs[package]
- : new Dictionary();
-
- byte[] rawDoc = parser.Docs[docFile];
- ASDocsReader dr = new ASDocsReader(rawDoc);
- dr.ExcludedASDocs = ExcludedASDocs;
+ var package = m.Groups[1].Value;
+ if (!Docs.TryGetValue(package, out var packageDocs))
+ packageDocs = new Dictionary();
+ var rawDoc = parser.Docs[docFile];
+ var dr = new ASDocsReader(rawDoc) {ExcludedASDocs = ExcludedASDocs};
dr.Parse(packageDocs);
-
Docs[package] = packageDocs;
}
- catch (Exception)
+ catch
{
}
}
@@ -80,7 +67,7 @@ private static void ParseDocumentation(ContentParser parser)
///
/// Create virtual FileModel objects from Abc bytecode
///
- ///
+ ///
///
///
public static void Convert(ContentParser parser, PathModel path, IASContext context)
@@ -91,10 +78,12 @@ public static void Convert(ContentParser parser, PathModel path, IASContext cont
ParseDocumentation(parser);
// extract models
- Dictionary models = new Dictionary();
- FileModel privateClasses = new FileModel(Path.Combine(path.Path, "__Private.as"));
- privateClasses.Version = 3;
- privateClasses.Package = "private";
+ var models = new Dictionary();
+ var privateClasses = new FileModel(Path.Combine(path.Path, "__Private.as"))
+ {
+ Version = 3,
+ Package = "private"
+ };
genericTypes = new Dictionary();
imports = new Dictionary();
conflicts = new Dictionary();
@@ -105,8 +94,7 @@ public static void Convert(ContentParser parser, PathModel path, IASContext cont
foreach (Traits trait in abc.classes)
{
Traits instance = trait.itraits;
- if (instance == null)
- continue;
+ if (instance is null) continue;
imports.Clear();
conflicts.Clear();
@@ -115,13 +103,11 @@ public static void Convert(ContentParser parser, PathModel path, IASContext cont
model.Package = reSafeChars.Replace(instance.name.uri, "_");
model.HasPackage = true;
string filename = reSafeChars.Replace(trait.name.ToString(), "_").TrimEnd('$');
- filename = Path.Combine(model.Package.Replace('.', Path.DirectorySeparatorChar), filename);
- model.FileName = Path.Combine(path.Path, filename);
+ model.FileName = Path.Combine(path.Path, model.Package.Replace('.', Path.DirectorySeparatorChar), filename);
model.Version = 3;
ClassModel type = new ClassModel();
- model.Classes = new List();
- model.Classes.Add(type);
+ model.Classes = new List {type};
type.InFile = model;
type.Type = instance.name.ToTypeString();
@@ -129,27 +115,35 @@ public static void Convert(ContentParser parser, PathModel path, IASContext cont
type.Flags = FlagType.Class;
conflicts.Add(type.Name, type.QualifiedName);
- if (instance.flags == TraitMember.Function)
+ if ((instance.flags & TraitFlag.Interface) > 0)
type.Flags |= FlagType.Interface;
+ else
+ {
+ if ((instance.flags & TraitFlag.Final) > 0)
+ type.Flags |= FlagType.Final;
+
+ if ((instance.flags & TraitFlag.Sealed) == 0)
+ type.Flags |= FlagType.Dynamic;
+
+ }
thisDocs = GetDocs(model.Package);
if (thisDocs != null)
{
docPath = (model.Package.Length > 0 ? model.Package + ":" : "globalClassifier:") + type.Name;
- if (thisDocs.ContainsKey(docPath))
+ if (thisDocs.TryGetValue(docPath, out var doc))
{
- ASDocItem doc = thisDocs[docPath];
- applyASDoc(doc, type);
- if (doc.Meta != null) model.MetaDatas = doc.Meta;
+ ApplyASDoc(doc, type);
+ if (doc.Meta != null) type.MetaDatas = doc.Meta;
}
if (model.Package.Length == 0) docPath = type.Name;
}
- if (instance.baseName.uri == model.Package)
- type.ExtendsType = ImportType(instance.baseName.localName);
- else type.ExtendsType = ImportType(instance.baseName);
+ type.ExtendsType = instance.baseName.uri == model.Package
+ ? ImportType(instance.baseName.localName)
+ : ImportType(instance.baseName);
- if (instance.interfaces != null && instance.interfaces.Length > 0)
+ if (!instance.interfaces.IsNullOrEmpty())
{
type.Implements = new List();
foreach (QName name in instance.interfaces)
@@ -168,22 +162,22 @@ public static void Convert(ContentParser parser, PathModel path, IASContext cont
type.Access = Visibility.Private;
type.Namespace = "private";
string genType = type.Name;
- if (type.Name.IndexOf("$") > 0)
+ if (type.Name.IndexOf('$') > 0)
{
string[] itype = type.Name.Split('$');
genType = itype[0];
type.Name = itype[0] + "$" + itype[1];
type.IndexType = itype[1];
}
- if (genericTypes.ContainsKey(genType))
+ if (genericTypes.TryGetValue(genType, out var inFile))
{
model.Classes.Clear();
- type.InFile = genericTypes[genType];
+ type.InFile = inFile;
genericTypes[genType].Classes.Add(type);
}
else genericTypes[genType] = model;
}
- else if (type.Name.StartsWith("_"))
+ else if (type.Name.StartsWith('_') && string.IsNullOrEmpty(model.Package))
{
type.Access = Visibility.Private;
type.Namespace = "private";
@@ -201,7 +195,7 @@ public static void Convert(ContentParser parser, PathModel path, IASContext cont
{
// TODO properly support interface multiple inheritance
type.ExtendsType = null;
- if (type.Implements != null && type.Implements.Count > 0)
+ if (!type.Implements.IsNullOrEmpty())
{
type.ExtendsType = type.Implements[0];
type.Implements.RemoveAt(0);
@@ -230,8 +224,6 @@ public static void Convert(ContentParser parser, PathModel path, IASContext cont
type.Members.Merge(result);
type.Constructor = ctor.Name;
}
- result = null;
- temp = null;
}
else type.Constructor = type.Name;
@@ -249,37 +241,31 @@ public static void Convert(ContentParser parser, PathModel path, IASContext cont
}
// packages
- if (abc.scripts == null)
- continue;
- foreach (Traits trait in abc.scripts)
+ if (abc.scripts is null) continue;
+ foreach (var trait in abc.scripts)
{
FileModel model = null;
- foreach (MemberInfo info in trait.members)
+ foreach (var info in trait.members)
{
- if (info.kind == TraitMember.Class)
- continue;
-
- MemberModel member = GetMember(info, 0);
- if (member == null) continue;
-
- if (model == null || model.Package != info.name.uri)
+ if (info.kind == TraitMember.Class) continue;
+ var member = GetMember(info, 0);
+ if (member is null) continue;
+ if (model is null || model.Package != info.name.uri)
{
AddImports(model, imports);
-
- string package = info.name.uri ?? "";
- string filename = package.Length > 0 ? "package.as" : "toplevel.as";
- filename = Path.Combine(package.Replace('.', Path.DirectorySeparatorChar), filename);
- filename = Path.Combine(path.Path, filename);
- if (models.ContainsKey(filename))
- model = models[filename];
- else
+ var package = info.name.uri ?? "";
+ var filename = package.Length > 0 ? "package.as" : "toplevel.as";
+ filename = Path.Combine(path.Path, package.Replace('.', Path.DirectorySeparatorChar), filename);
+ if (!models.TryGetValue(filename, out model))
{
- model = new FileModel("");
- model.Context = context;
- model.Package = package;
- model.HasPackage = true;
- model.FileName = filename;
- model.Version = 3;
+ model = new FileModel
+ {
+ Context = context,
+ Package = package,
+ HasPackage = true,
+ FileName = filename,
+ Version = 3
+ };
models[filename] = model;
}
}
@@ -289,20 +275,17 @@ public static void Convert(ContentParser parser, PathModel path, IASContext cont
{
docPath = "globalOperation:" + (model.Package.Length > 0 ? model.Package + ":" : "")
+ member.Name;
- if (member.Access == Visibility.Public && !String.IsNullOrEmpty(member.Namespace)
+ if (member.Access == Visibility.Public && !string.IsNullOrEmpty(member.Namespace)
&& member.Namespace != "public")
docPath += member.Namespace + ":";
if ((member.Flags & FlagType.Setter) > 0) docPath += ":set";
else if ((member.Flags & FlagType.Getter) > 0) docPath += ":get";
-
- if (thisDocs.ContainsKey(docPath)) applyASDoc(thisDocs[docPath], member);
+ if (thisDocs.TryGetValue(docPath, out var doc)) ApplyASDoc(doc, member);
}
-
member.InFile = model;
member.IsPackageLevel = true;
model.Members.Add(member);
}
-
AddImports(model, imports);
}
}
@@ -329,99 +312,82 @@ public static void Convert(ContentParser parser, PathModel path, IASContext cont
///
/// old name: setDoc()
///
- private static void applyASDoc(ASDocItem doc, MemberModel model)
+ static void ApplyASDoc(ASDocItem doc, MemberModel model)
{
model.Comments = doc.LongDesc;
-
- if (doc.IsFinal)
- model.Flags |= FlagType.Final;
-
- if (doc.IsDynamic && (model is ClassModel))
- model.Flags |= FlagType.Dynamic;
-
- if (doc.Value != null)
- model.Value = doc.Value;
-
+ if (doc.IsFinal) model.Flags |= FlagType.Final;
+ if (doc.IsDynamic && model is ClassModel) model.Flags |= FlagType.Dynamic;
+ if (doc.Value != null) model.Value = doc.Value;
// TODO Extract features in comments
- applyTypeComment(doc, model);
- applyTypeCommentToParams(doc, model);
+ ApplyTypeComment(doc, model);
+ ApplyTypeCommentToParams(doc, model);
}
- private static void applyTypeComment(ASDocItem doc, MemberModel model)
+ static void ApplyTypeComment(ASDocItem doc, MemberModel model)
{
- if (doc == null || model ==null)
- return;
-
+ if (doc is null || model is null) return;
ASFileParserUtils.ParseTypeDefinitionInto(doc.ApiType, model, true, true);
}
- private static void applyTypeCommentToParams(ASDocItem doc, MemberModel model)
+ static void ApplyTypeCommentToParams(ASDocItem doc, MemberModel model)
{
- if (doc == null || model == null || model.Parameters == null)
- return;
-
- foreach (MemberModel param in model.Parameters)
- if (doc.ParamTypes != null && doc.ParamTypes.ContainsKey(param.Name))
- ASFileParserUtils.ParseTypeDefinitionInto(doc.ParamTypes[param.Name], param, true, true);
+ if (doc is null || model?.Parameters is null) return;
+ foreach (var param in model.Parameters)
+ if (doc.ParamTypes != null && doc.ParamTypes.TryGetValue(param.Name, out var typeDefinition))
+ ASFileParserUtils.ParseTypeDefinitionInto(typeDefinition, param, true, true);
}
- private static void CustomFixes(string path, Dictionary models)
+ static void CustomFixes(string path, IDictionary models)
{
- string file = Path.GetFileName(path);
- if (file == "playerglobal.swc" || file == "airglobal.swc")
+ var file = Path.GetFileName(path);
+ if (file != "playerglobal.swc" && file != "airglobal.swc") return;
+ var mathPath = Path.Combine(path, "Math");
+ if (models.TryGetValue(mathPath, out var model))
{
- string mathPath = Path.Combine(path, "Math");
- if (models.ContainsKey(mathPath))
+ var @class = model.GetPublicClass();
+ foreach (var member in @class.Members)
{
- ClassModel mathModel = models[mathPath].GetPublicClass();
- foreach (MemberModel member in mathModel.Members)
+ if (!member.Parameters.IsNullOrEmpty() && member.Parameters[0].Name == "x")
{
- if (member.Parameters != null && member.Parameters.Count > 0 && member.Parameters[0].Name == "x")
+ string n = member.Name;
+ if (member.Parameters.Count > 1)
{
- string n = member.Name;
- if (member.Parameters.Count > 1)
- {
- if (n == "atan2") member.Parameters.Reverse();
- else if (n == "min" || n == "max") { member.Parameters[0].Name = "val1"; member.Parameters[1].Name = "val2"; }
- else if (n == "pow") { member.Parameters[0].Name = "base"; member.Parameters[1].Name = "pow"; }
- }
- else if (n == "sin" || n == "cos" || n == "tan") member.Parameters[0].Name = "angleRadians";
- else member.Parameters[0].Name = "val";
+ if (n == "atan2") member.Parameters.Reverse();
+ else if (n == "min" || n == "max") { member.Parameters[0].Name = "val1"; member.Parameters[1].Name = "val2"; }
+ else if (n == "pow") { member.Parameters[0].Name = "base"; member.Parameters[1].Name = "pow"; }
}
+ else if (n == "sin" || n == "cos" || n == "tan") member.Parameters[0].Name = "angleRadians";
+ else member.Parameters[0].Name = "val";
}
}
- string objPath = Path.Combine(path, "Object");
- if (models.ContainsKey(objPath))
+ }
+ var objPath = Path.Combine(path, "Object");
+ if (models.TryGetValue(objPath, out model))
+ {
+ var @class = model.GetPublicClass();
+ if (!@class.Members.Contains("prototype"))
{
- ClassModel objModel = models[objPath].GetPublicClass();
- if (objModel.Members.Search("prototype", 0, 0) == null)
- {
- MemberModel proto = new MemberModel("prototype", "Object", FlagType.Dynamic | FlagType.Variable, Visibility.Public);
- objModel.Members.Add(proto);
- }
+ @class.Members.Add(new MemberModel("prototype", "Object", FlagType.Dynamic | FlagType.Variable, Visibility.Public));
}
}
}
- private static void AddImports(FileModel model, Dictionary imports)
+ static void AddImports(FileModel model, Dictionary imports)
{
- if (model != null)
- {
- foreach (string import in imports.Keys)
- model.Imports.Add(new MemberModel(imports[import], import, FlagType.Import, 0));
-
- imports.Clear();
- }
+ if (model is null) return;
+ foreach (var pair in imports)
+ model.Imports.Add(new MemberModel(pair.Value, pair.Key, FlagType.Import, 0));
+ imports.Clear();
}
- private static Dictionary GetDocs(string package)
+ static Dictionary GetDocs(string package)
{
- string docPackage = package == "" ? "__Global__" : package;
- if (Docs.ContainsKey(docPackage)) return Docs[docPackage];
- else return null;
+ var docPackage = package == "" ? "__Global__" : package;
+ Docs.TryGetValue(docPackage, out var result);
+ return result;
}
- private static MemberList GetMembers(List abcMembers, FlagType baseFlags, QName instName)
+ static MemberList GetMembers(IEnumerable abcMembers, FlagType baseFlags, QName instName)
{
MemberList list = new MemberList();
string package = instName.uri;
@@ -430,16 +396,13 @@ private static MemberList GetMembers(List abcMembers, FlagType baseF
foreach (MemberInfo info in abcMembers)
{
MemberModel member = GetMember(info, baseFlags);
- if (member == null) continue;
+ if (member is null) continue;
string uri = info.name.uri ?? "";
if (uri.Length > 0)
{
- if (uri == "private" || package == "private")
- {
- continue;
- }
- else if (uri == protect)
+ if (uri == "private" || package == "private") continue;
+ if (uri == protect)
{
member.Access = Visibility.Protected;
member.Namespace = "protected";
@@ -482,41 +445,64 @@ private static MemberList GetMembers(List abcMembers, FlagType baseF
return list;
}
- private static MemberModel GetMember(MemberInfo info, FlagType baseFlags)
+ static MemberModel GetMember(MemberInfo info, FlagType baseFlags)
{
- MemberModel member = new MemberModel();
- member.Name = info.name.localName;
- member.Flags = baseFlags;
- member.Access = Visibility.Public;
- member.Namespace = "public";
+ var member = new MemberModel
+ {
+ Name = info.name.localName,
+ Flags = baseFlags,
+ Access = Visibility.Public,
+ Namespace = "public"
+ };
+ if (!info.metadata.IsNullOrEmpty())
+ {
+ var metadatas = member.MetaDatas;
+ foreach (var metaInfo in info.metadata)
+ {
+ if (metaInfo.name == "__go_to_definition_help") continue;
+ var meta = new ASMetaData(metaInfo.name);
+ var rawParams = new StringBuilder();
+ meta.Params = new Dictionary(metaInfo.Count);
+ foreach (var entry in metaInfo)
+ {
+ if (entry.Length != 2) continue;
+ meta.Params[entry[0]] = entry[1];
+ if (rawParams.Length > 0) rawParams.Append(",");
+ rawParams.Append(entry[0] + "=\"" + entry[1] + "\"");
+ }
+ meta.RawParams = rawParams.ToString();
- if (info is SlotInfo)
+ metadatas ??= new List(info.metadata.Count);
+ metadatas.Add(meta);
+ }
+ member.MetaDatas = metadatas;
+ }
+
+ if (info is SlotInfo slot)
{
- SlotInfo slot = info as SlotInfo;
member.Flags |= FlagType.Variable;
if (slot.kind == TraitMember.Const) member.Flags |= FlagType.Constant;
- if (slot.value is Namespace)
+ if (slot.value is Namespace ns)
{
member.Flags |= FlagType.Namespace;
- member.Value = '"' + (slot.value as Namespace).uri + '"';
+ member.Value = '"' + ns.uri + '"';
}
member.Type = ImportType(slot.type);
}
- else if (info is MethodInfo)
+ else if (info is MethodInfo method)
{
- switch (info.kind)
+ member.Flags |= method.kind switch
{
- case TraitMember.Setter: member.Flags |= FlagType.Setter; break;
- case TraitMember.Getter: member.Flags |= FlagType.Getter; break;
- default: member.Flags |= FlagType.Function; break;
- }
- MethodInfo method = info as MethodInfo;
+ TraitMember.Setter => FlagType.Setter,
+ TraitMember.Getter => FlagType.Getter,
+ _ => FlagType.Function,
+ };
QName type = method.returnType;
member.Type = ImportType(type);
member.Parameters = new List();
int n = method.paramTypes.Length;
- int defaultValues = (method.optionalValues != null) ? n - method.optionalValues.Length : n;
+ int defaultValues = n - method.optionalValues?.Length ?? n;
for (int i = 0; i < n; i++)
{
MemberModel param = new MemberModel();
@@ -536,47 +522,37 @@ private static MemberModel GetMember(MemberInfo info, FlagType baseFlags)
member.Parameters.Add(param);
}
}
- else
- {
- member = null;
- }
-
+ else member = null;
return member;
}
- private static void GetMemberDoc(MemberModel member)
+ static void GetMemberDoc(MemberModel member)
{
string dPath = docPath + ":";
- if (member.Access == Visibility.Public && !String.IsNullOrEmpty(member.Namespace)
+ if (member.Access == Visibility.Public && !string.IsNullOrEmpty(member.Namespace)
&& member.Namespace != "public")
dPath += member.Namespace + ":";
dPath += member.Name;
if ((member.Flags & FlagType.Getter) > 0) dPath += ":get";
else if ((member.Flags & FlagType.Setter) > 0) dPath += ":set";
-
- if (thisDocs.ContainsKey(dPath)) applyASDoc(thisDocs[dPath], member);
+ if (thisDocs.TryGetValue(dPath, out var doc)) ApplyASDoc(doc, member);
}
- private static string ImportType(QName type)
- {
- if (type == null) return "*";
- else return ImportType(type.ToTypeString());
- }
+ static string ImportType(QName type) => type is null ? "*" : ImportType(type.ToTypeString());
- private static string ImportType(string qname)
+ static string ImportType(string qname)
{
- if (qname == null) return "*";
+ if (qname is null) return "*";
int p = qname.LastIndexOf('.');
int q = qname.LastIndexOf('<');
if (q > 0)
{
p = qname.IndexOf('>', q);
if (p <= q) return qname;
- else
- return qname.Substring(0, q + 1) + ImportType(qname.Substring(q + 1, p - q - 1)) + qname.Substring(p);
+ return qname.Substring(0, q + 1) + ImportType(qname.Substring(q + 1, p - q - 1)) + qname.Substring(p);
}
if (p < 0) return qname;
- if (imports.ContainsKey(qname)) return imports[qname];
+ if (imports.TryGetValue(qname, out var import)) return import;
string cname = qname.Substring(p + 1);
if (!conflicts.ContainsKey(cname)) conflicts.Add(cname, qname);
else if (conflicts[cname] != qname)
@@ -585,13 +561,16 @@ private static string ImportType(string qname)
return cname;
}
- private static void SetDefaultValue(MemberModel member, object value)
+ static void SetDefaultValue(MemberModel member, object value)
{
- if (value == null) member.Value = "null";
- else if (value is string && value.ToString() != "undefined") member.Value = '"' + value.ToString() + '"';
- else if (value is bool) member.Value = value.ToString().ToLower();
- else if (value is double) member.Value = ((double)value).ToString(CultureInfo.InvariantCulture.NumberFormat);
- else member.Value = value.ToString();
+ member.Value = value switch
+ {
+ null => "null",
+ string _ when value.ToString() != "undefined" => '"' + value.ToString() + '"',
+ bool _ => value.ToString().ToLower(),
+ double d => d.ToString(CultureInfo.InvariantCulture.NumberFormat),
+ _ => value.ToString(),
+ };
}
}
@@ -601,14 +580,16 @@ private static void SetDefaultValue(MemberModel member, object value)
public class ASDocItem
{
- public bool IsFinal = false;
- public bool IsDynamic = false;
+ public bool IsFinal;
+ public bool IsDynamic;
+ public bool IsStatic;
- public string ShortDesc = null;
- public string LongDesc = null;
- public string Returns = null;
- public string Value = null;
- public string ApiType = null;
+ public string ShortDesc;
+ public string LongDesc;
+ public string Returns;
+ public string Value;
+ public string ApiType;
+ public string DeclType;
public List Meta;
public Dictionary Params = new Dictionary();
@@ -622,8 +603,8 @@ public class ASDocItem
class ASDocsReader : XmlTextReader
{
- public List ExcludedASDocs = null;
- private Dictionary docs;
+ public List ExcludedASDocs;
+ Dictionary docs;
public ASDocsReader(byte[] raw)
@@ -646,27 +627,22 @@ public void Parse(Dictionary packageDocs)
//---------------------------
- // PRIMARY
+ // PRIMARY
//---------------------------
- private void ReadDeclaration()
+ void ReadDeclaration(string declType)
{
- if (IsEmptyElement)
- return;
-
- if (this.ExcludedASDocs == null)
- this.ExcludedASDocs = new List();
-
- ASDocItem doc = new ASDocItem();
- string id = GetAttribute("id");
-
+ if (IsEmptyElement) return;
+ ExcludedASDocs ??= new List();
+ var doc = new ASDocItem {DeclType = declType};
+ var id = GetAttribute("id");
if (id != null)
{
// type doubled in doc: "flash.utils:IDataOutput:flash.utils:IDataOutput:writeDouble"
int colon = id.IndexOf(':') + 1;
if (colon > 0)
{
- int dup = id.IndexOf(id.Substring(0, colon), colon);
+ int dup = id.IndexOfOrdinal(id.Substring(0, colon), colon);
if (dup > 0) id = id.Substring(dup);
}
doc.ApiType = id;
@@ -682,47 +658,43 @@ private void ReadDeclaration()
if (id != null)
{
- if (doc.ApiType == "String" && doc.Value != null && !doc.Value.StartsWith("\""))
+ if (doc.ApiType == "String" && doc.Value != null && !doc.Value.StartsWith('"'))
doc.Value = "\"" + doc.Value + "\"";
- if (doc.LongDesc == null)
- doc.LongDesc = "";
+ doc.LongDesc ??= "";
- if (doc.ShortDesc == null)
- doc.ShortDesc = doc.LongDesc;
- else
- doc.LongDesc = doc.LongDesc.Trim();
+ if (doc.ShortDesc is null) doc.ShortDesc = doc.LongDesc;
+ else doc.LongDesc = doc.LongDesc.Trim();
if (doc.LongDesc.Length == 0 && doc.ShortDesc.Length > 0)
doc.LongDesc = doc.ShortDesc;
- if (!this.ExcludedASDocs.Contains("param") && doc.Params != null)
+ if (!ExcludedASDocs.Contains("param") && doc.Params != null)
foreach (string name in doc.Params.Keys)
doc.LongDesc += "\n@param\t" + name + "\t" + doc.Params[name].Trim();
- if (!this.ExcludedASDocs.Contains("return") && doc.Returns != null)
+ if (!ExcludedASDocs.Contains("return") && doc.Returns != null)
doc.LongDesc += "\n@return\t" + doc.Returns.Trim();
if (doc.ExtraAsDocs != null)
- foreach (KeyValuePair extraASDoc in doc.ExtraAsDocs)
- if (!this.ExcludedASDocs.Contains(extraASDoc.Key))
+ foreach (var extraASDoc in doc.ExtraAsDocs)
+ if (!ExcludedASDocs.Contains(extraASDoc.Key))
doc.LongDesc += "\n@" + extraASDoc.Key + "\t" + extraASDoc.Value;
- if (doc.ShortDesc.Length > 0 || doc.LongDesc.Length > 0)
+ // keep definitions including either documentation or static values
+ if (doc.ShortDesc.Length > 0 || doc.LongDesc.Length > 0
+ || (doc.IsStatic && doc.Value != null && doc.DeclType == "apiValue"))
docs[id] = doc;
}
}
- private void ProcessDeclarationNodes(ASDocItem doc)
+ void ProcessDeclarationNodes(ASDocItem doc)
{
- if (NodeType != XmlNodeType.Element)
- return;
-
+ if (NodeType != XmlNodeType.Element) return;
switch (Name)
{
case "apiName": break; // TODO validate event name
case "apiInheritDoc": break; // TODO link inherited doc?
-
case "apiDetail":
case "related-links": SkipContents(); break;
@@ -734,7 +706,7 @@ private void ProcessDeclarationNodes(ASDocItem doc)
case "apiValue":
case "apiOperation":
case "apiConstructor":
- ReadDeclaration();
+ ReadDeclaration(Name);
break;
case "shortdesc": doc.ShortDesc = ReadValue(); break;
@@ -747,6 +719,8 @@ private void ProcessDeclarationNodes(ASDocItem doc)
case "adobeApiEvent": ReadEventMeta(doc); break;
case "apiFinal": doc.IsFinal = true; SkipContents(); break;
+ case "apiStatic":
+ doc.IsStatic = true; break;
case "apiParam": ReadParamDesc(doc); break;
case "apiReturn": ReadReturnsDesc(doc); break;
@@ -761,10 +735,10 @@ private void ProcessDeclarationNodes(ASDocItem doc)
//---------------------------
- // COMMONS
+ // COMMONS
//---------------------------
- private void SkipContents()
+ void SkipContents()
{
if (IsEmptyElement)
return;
@@ -775,7 +749,7 @@ private void SkipContents()
Read();
}
- private string ReadValue()
+ string ReadValue()
{
if (IsEmptyElement)
{
@@ -789,11 +763,10 @@ private string ReadValue()
string prefix = "";
string postfix = "";
string eon = Name;
- string lcName; // name in lower case
ReadStartElement();
while (Name != eon)
{
- lcName = Name.ToLower();
+ var lcName = Name.ToLower(); // name in lower case
if (lcName == "codeblock" || lcName == "listing")
{
if (NodeType == XmlNodeType.Element)
@@ -830,10 +803,10 @@ private string ReadValue()
//---------------------------
- // apiClassifierDetail
+ // apiClassifierDetail
//---------------------------
- private void ReadApiClassifierDetail(ASDocItem doc)
+ void ReadApiClassifierDetail(ASDocItem doc)
{
doc.LongDesc = "";
@@ -852,23 +825,23 @@ private void ReadApiClassifierDetail(ASDocItem doc)
break;
case "apiDesc":
- doc.LongDesc += this.ReadInnerXml() +"\n";
+ doc.LongDesc += ReadInnerXml() +"\n";
// Read();
break;
case "example":
- doc.LongDesc += "\nEXAMPLE: \n\n" + this.ReadInnerXml() +"\n";
+ doc.LongDesc += "\nEXAMPLE: \n\n" + ReadInnerXml() +"\n";
// Read();
break;
default:
- this.ReadInnerXml();
+ ReadInnerXml();
break;
}
}
}
- private void ReadApiClassifierDef(ASDocItem doc)
+ void ReadApiClassifierDef(ASDocItem doc)
{
if (IsEmptyElement)
return;
@@ -888,31 +861,31 @@ private void ReadApiClassifierDef(ASDocItem doc)
//---------------------------
- // prolog
+ // prolog
//---------------------------
///
/// ---
/// Example:
///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- ///
- /// ---
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// ---
///
///
- private void ReadProlog(ASDocItem doc)
+ void ReadProlog(ASDocItem doc)
{
if (IsEmptyElement)
return;
@@ -930,7 +903,7 @@ private void ReadProlog(ASDocItem doc)
}
}
- private void ReadPrologMetadata(ASDocItem doc)
+ void ReadPrologMetadata(ASDocItem doc)
{
if (IsEmptyElement)
return;
@@ -941,23 +914,25 @@ private void ReadPrologMetadata(ASDocItem doc)
{
if (Name == "apiVersion")
ReadPrologMetadataApiVersion(doc);
-
+ else if (Name == "styles")
+ ReadPrologMetadataStyles(doc);
+ else if (Name == "DefaultProperty")
+ ReadPrologMetadataDefaultProperty(doc);
Read();
}
}
- private void ReadPrologMetadataApiVersion(ASDocItem doc)
+ void ReadPrologMetadataApiVersion(ASDocItem doc)
{
if (IsEmptyElement)
return;
- string asdocKey;
- string asdocVal;
-
string eon = Name;
ReadStartElement();
while (Name != eon)
{
+ string asdocVal;
+ string asdocKey;
if (Name == "apiLanguage")
{
string sVers = GetAttribute("version");
@@ -994,19 +969,48 @@ private void ReadPrologMetadataApiVersion(ASDocItem doc)
}
}
- private void ReadPrologCustoms(ASDocItem doc, string terminationNode)
+ void ReadPrologMetadataStyles(ASDocItem doc)
{
if (IsEmptyElement)
return;
- string asdocKey;
- string asdocVal;
+ string eon = Name;
+ ReadStartElement();
+ while (Name != eon)
+ {
+ if (Name == "style")
+ ReadStyleMeta(doc);
+ Read();
+ }
+ }
+
+ void ReadPrologMetadataDefaultProperty(ASDocItem doc)
+ {
+ ASMetaData meta = new ASMetaData("DefaultProperty");
+ meta.Kind = ASMetaKind.DefaultProperty;
+ meta.Comments = "";
+
+ meta.Params = new Dictionary();
+
+ string defValue = GetAttribute("name");
+ meta.Params["default"] = defValue;
+
+ meta.RawParams = $"\"{defValue}\"";
+
+ doc.Meta ??= new List();
+ doc.Meta.Add(meta);
+ }
+
+ void ReadPrologCustoms(ASDocItem doc, string terminationNode)
+ {
+ if (IsEmptyElement)
+ return;
string eon = terminationNode;
ReadStartElement();
while (!(Name == eon && NodeType == XmlNodeType.EndElement))
{
- asdocKey = this.Name;
+ var asdocKey = Name;
/*
if (asdocKey == "maelexample")
@@ -1017,7 +1021,7 @@ private void ReadPrologCustoms(ASDocItem doc, string terminationNode)
else
{
*/
- asdocVal = this.ReadInnerXml();
+ var asdocVal = ReadInnerXml();
// }
doc.ExtraAsDocs.Add(new KeyValuePair(asdocKey, asdocVal));
@@ -1026,30 +1030,20 @@ private void ReadPrologCustoms(ASDocItem doc, string terminationNode)
//---------------------------
- // apiType
+ // apiType
//---------------------------
- private void ReadApiType(ASDocItem doc)
- {
- SetApiType(doc, GetAttribute("value"));
- }
-
- private void ReadApiTypeAsClassifier(ASDocItem doc)
- {
- SetApiType(doc, ReadValue());
- }
-
- private void SetApiType(ASDocItem doc, string apiType)
- {
- doc.ApiType = apiType == "any" ? "*" : apiType;
- }
+ void ReadApiType(ASDocItem doc) => SetApiType(doc, GetAttribute("value"));
+ void ReadApiTypeAsClassifier(ASDocItem doc) => SetApiType(doc, ReadValue());
+ static void SetApiType(ASDocItem doc, string apiType) => doc.ApiType = apiType == "any" ? "*" : apiType;
+
//---------------------------
- // apiOperationDetail
+ // apiOperationDetail
//---------------------------
- private void ReadParamDesc(ASDocItem doc)
+ void ReadParamDesc(ASDocItem doc)
{
if (IsEmptyElement)
return;
@@ -1092,7 +1086,7 @@ private void ReadParamDesc(ASDocItem doc)
}
}
- private void ReadReturnsDesc(ASDocItem doc)
+ void ReadReturnsDesc(ASDocItem doc)
{
if (IsEmptyElement)
return;
@@ -1101,7 +1095,7 @@ private void ReadReturnsDesc(ASDocItem doc)
ReadStartElement();
while (Name != eon)
{
- switch (this.Name)
+ switch (Name)
{
case "apiDesc":
doc.Returns = ReadValue();
@@ -1122,17 +1116,16 @@ private void ReadReturnsDesc(ASDocItem doc)
//---------------------------
- // apiException
+ // apiException
//---------------------------
- private void ReadApiException(ASDocItem doc)
+ void ReadApiException(ASDocItem doc)
{
if (IsEmptyElement)
return;
string apiDesc = "";
string apiItemName = "";
- string apiOperationClassifier = "";
string eon = Name;
ReadStartElement();
@@ -1149,7 +1142,7 @@ private void ReadApiException(ASDocItem doc)
break;
case "apiOperationClassifier":
- apiOperationClassifier = ReadValue();
+ ReadValue();
break;
}
Read();
@@ -1160,27 +1153,24 @@ private void ReadApiException(ASDocItem doc)
//---------------------------
- // Meta tags
+ // Meta tags
//---------------------------
- private void ReadExcludeMeta(ASDocItem doc)
+ void ReadExcludeMeta(ASDocItem doc)
{
if (!HasAttributes) return;
- ASMetaData meta = new ASMetaData("Style");
- meta.Kind = ASMetaKind.Exclude;
+ ASMetaData meta = new ASMetaData("Style") {Kind = ASMetaKind.Exclude};
string sKind = GetAttribute("kind");
string sName = GetAttribute("name");
- if (doc.Meta == null) doc.Meta = new List();
- meta.Params = new Dictionary();
- meta.Params["kind"] = sKind;
- meta.Params["name"] = sName;
- meta.RawParams = String.Format("kind=\"{0}\", name=\"{1}\"", sKind, sName);
+ doc.Meta ??= new List();
+ meta.Params = new Dictionary {["kind"] = sKind, ["name"] = sName};
+ meta.RawParams = $"kind=\"{sKind}\", name=\"{sName}\"";
doc.Meta.Add(meta);
}
- private void ReadStyleMeta(ASDocItem doc)
+ void ReadStyleMeta(ASDocItem doc)
{
if (IsEmptyElement || !HasAttributes) return;
@@ -1190,7 +1180,7 @@ private void ReadStyleMeta(ASDocItem doc)
string sName = GetAttribute("name");
string sType = GetAttribute("type");
- //string sInherit = GetAttribute("inherit");
+ string sInherit = GetAttribute("inherit");
//string sFormat = GetAttribute("format");
string sEnum = GetAttribute("enumeration");
string sDefault = null;
@@ -1208,12 +1198,15 @@ private void ReadStyleMeta(ASDocItem doc)
Read();
}
- if (doc.Meta == null) doc.Meta = new List();
+ doc.Meta ??= new List();
if (sDefault != null) meta.Comments = meta.Comments.Trim() + "\n@default\t" + sDefault;
- meta.Params = new Dictionary();
- meta.Params["name"] = sName;
- meta.Params["type"] = sType;
- meta.RawParams = String.Format("name=\"{0}\", type=\"{1}\"", sName, sType);
+ meta.Params = new Dictionary {["name"] = sName, ["type"] = sType};
+ meta.RawParams = $"name=\"{sName}\", type=\"{sType}\"";
+ if (sInherit != null)
+ {
+ meta.Params["inherit"] = sInherit;
+ meta.RawParams += ", inherit=\"" + sInherit + "\"";
+ }
if (sEnum != null)
{
meta.Params["enumeration"] = sEnum;
@@ -1222,7 +1215,7 @@ private void ReadStyleMeta(ASDocItem doc)
doc.Meta.Add(meta);
}
- private void ReadEventMeta(ASDocItem doc)
+ void ReadEventMeta(ASDocItem doc)
{
if (IsEmptyElement) return;
@@ -1249,13 +1242,11 @@ private void ReadEventMeta(ASDocItem doc)
Read();
}
- if (doc.Meta == null) doc.Meta = new List();
- meta.Params = new Dictionary();
- meta.Params["name"] = eName;
- meta.Params["type"] = eType;
+ doc.Meta ??= new List();
+ meta.Params = new Dictionary {["name"] = eName, ["type"] = eType};
if (eFullType != null)
meta.Comments = meta.Comments.Trim() + "\n@eventType\t" + eFullType.Replace(':', '.');
- meta.RawParams = String.Format("name=\"{0}\", type=\"{1}\"", eName, eType);
+ meta.RawParams = $"name=\"{eName}\", type=\"{eType}\"";
doc.Meta.Add(meta);
}
}
diff --git a/External/Plugins/AS3Context/Compiler/FdbWrapper.cs b/External/Plugins/AS3Context/Compiler/FdbWrapper.cs
index a86d946e02..84e22c343c 100644
--- a/External/Plugins/AS3Context/Compiler/FdbWrapper.cs
+++ b/External/Plugins/AS3Context/Compiler/FdbWrapper.cs
@@ -1,12 +1,11 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.Diagnostics;
-using System.Threading;
using System.IO;
+using System.Text;
using System.Text.RegularExpressions;
+using System.Threading;
using PluginCore.Helpers;
-using System.Collections;
namespace AS3Context.Compiler
{
@@ -22,17 +21,18 @@ public class FdbWrapper
public void Run(string projectPath, string flexSDKPath)
{
flexSDKPath = PathHelper.ResolvePath(flexSDKPath, projectPath);
- if (flexSDKPath != null && Directory.Exists(flexSDKPath))
+ if (Directory.Exists(flexSDKPath))
{
if (flexSDKPath.EndsWith("bin", StringComparison.OrdinalIgnoreCase))
flexSDKPath = Path.GetDirectoryName(flexSDKPath);
}
else return;
- Dictionary jvmConfig = JvmConfigHelper.ReadConfig(flexSDKPath);
-
- if (process == null || process.HasExited)
+ if (process is null || process.HasExited)
+ {
+ var jvmConfig = JvmConfigHelper.ReadConfig(flexSDKPath);
Initialize(flexSDKPath, jvmConfig, projectPath);
+ }
}
public void PushCommand(string cmd)
@@ -65,7 +65,8 @@ bool Initialize(string flexSDKPath, Dictionary jvmConfig, string
{
cmdQueue = new Queue();
- string fdbPath = Path.Combine(flexSDKPath, "lib\\fdb.jar");
+ var fdbPath = Path.Combine(flexSDKPath, "lib\\fdb.jar");
+ if (!File.Exists(fdbPath)) fdbPath = Path.Combine(flexSDKPath, "lib\\legacy\\fdb.jar");
if (!File.Exists(fdbPath))
{
process = null;
@@ -80,8 +81,7 @@ bool Initialize(string flexSDKPath, Dictionary jvmConfig, string
process.StartInfo.RedirectStandardError = true;
process.StartInfo.CreateNoWindow = true;
process.StartInfo.FileName = JvmConfigHelper.GetJavaEXE(jvmConfig);
- process.StartInfo.Arguments = jvmConfig["java.args"]
- + " -Dfile.encoding=UTF-8 -Dapplication.home=\"" + flexSDKPath + "\" -jar \"" + fdbPath + "\"";
+ process.StartInfo.Arguments = jvmConfig["java.args"] + " -Dfile.encoding=UTF-8 -Dapplication.home=\"" + flexSDKPath + "\" -jar \"" + fdbPath + "\"";
process.StartInfo.WorkingDirectory = workingDir;
process.StartInfo.StandardErrorEncoding = Encoding.UTF8;
process.StartInfo.StandardOutputEncoding = Encoding.UTF8;
@@ -103,7 +103,7 @@ void process_Exited(object sender, EventArgs e)
{
keepAlive = false;
Cleanup();
- if (OnOutput != null) OnOutput("[FDB halted]");
+ OnOutput?.Invoke("[FDB halted]");
}
public void Cleanup()
@@ -112,7 +112,7 @@ public void Cleanup()
if (process != null && !process.HasExited && keepAlive)
{
keepAlive = false;
- if (OnOutput != null) OnOutput("[Shutting down FDB]");
+ OnOutput?.Invoke("[Shutting down FDB]");
try
{
if (!process.HasExited) process.Kill();
@@ -147,13 +147,13 @@ void FdbRun()
running = true;
WriteToPrompt("run");
Thread.Sleep(200);
- if (OnStarted != null) OnStarted(null);
+ OnStarted?.Invoke(null);
}
// send commands queue
else if (cmdQueue.Count > 0) WriteToPrompt(cmdQueue.Dequeue());
// default behavior
else if (connected) WriteToPrompt("continue");
- else if (!connected)
+ else
{
connectedEvent.WaitOne(250, false);
connectedEvent.Reset();
@@ -162,7 +162,7 @@ void FdbRun()
}
if (process != null && !process.HasExited)
{
- if (OnOutput != null) OnOutput("[Shutting down FDB]");
+ OnOutput?.Invoke("[Shutting down FDB]");
try
{
if (!process.HasExited) process.Kill();
@@ -176,16 +176,15 @@ void ReadErrors()
while (keepAlive && !process.StandardError.EndOfStream)
{
string line = process.StandardError.ReadLine();
- if (OnError != null) OnError(line);
+ OnError?.Invoke(line);
}
}
void WriteToPrompt(string line)
{
interactive = false;
- if (process != null)
- process.StandardInput.WriteLine(line);
- if (OnOutput != null) OnOutput("(fdb) "+line);
+ process?.StandardInput.WriteLine(line);
+ OnOutput?.Invoke("(fdb) "+line);
}
///
@@ -200,14 +199,12 @@ void ReadUntilPrompt()
void ReadUntilToken(string token)
{
- StringBuilder output = new StringBuilder();
- Queue queue = new Queue();
-
- bool keepProcessing = true;
+ var output = new StringBuilder();
+ var queue = new Queue();
+ var keepProcessing = true;
while (keepProcessing && keepAlive)
{
- if (process == null || process.HasExited)
- keepProcessing = false;
+ if (process is null || process.HasExited) keepProcessing = false;
else
{
char c = (char)process.StandardOutput.Read();
@@ -234,12 +231,12 @@ void ReadUntilToken(string token)
#region Understanding
- static Regex reTrace = new Regex(@"^?\[trace\]", RegexOptions.Compiled);
- static Regex reFault = new Regex(@"^(\[Fault\]|Fault,) ", RegexOptions.Compiled);
- static Regex reLoad = new Regex(@"^\[SWF\] ", RegexOptions.Compiled);
- static Regex reUnload = new Regex(@"^\[UnloadSWF\] ", RegexOptions.Compiled);
- static Regex reDisconnect = new Regex(@"^Player session terminated", RegexOptions.Compiled);
- static Regex reContinue = new Regex(@"'continue'", RegexOptions.Compiled);
+ static readonly Regex reTrace = new Regex(@"^?\[trace\]", RegexOptions.Compiled);
+ static readonly Regex reFault = new Regex(@"^(\[Fault\]|Fault,) ", RegexOptions.Compiled);
+ static readonly Regex reLoad = new Regex(@"^\[SWF\] ", RegexOptions.Compiled);
+ static readonly Regex reUnload = new Regex(@"^\[UnloadSWF\] ", RegexOptions.Compiled);
+ static readonly Regex reDisconnect = new Regex(@"^Player session terminated", RegexOptions.Compiled);
+ static readonly Regex reContinue = new Regex(@"'continue'", RegexOptions.Compiled);
void MatchLine(string line)
{
@@ -254,11 +251,11 @@ void MatchLine(string line)
// [trace] Hello World!
else if (reTrace.IsMatch(line))
{
- if (OnTrace != null)
+ if (OnTrace is { } onTrace)
{
- string trace = line.Substring(line.IndexOf(']') + 1);
- if (trace.Length > 0 && Char.IsWhiteSpace(trace[0])) OnTrace(trace.Substring(1));
- else OnTrace(trace);
+ var trace = line.Substring(line.IndexOf(']') + 1);
+ if (trace.Length > 0 && char.IsWhiteSpace(trace[0])) onTrace(trace.Substring(1));
+ else onTrace(trace);
return;
}
}
@@ -267,9 +264,9 @@ void MatchLine(string line)
// 20
else if (reFault.IsMatch(line))
{
- if (OnError != null)
+ if (OnError is { } onError)
{
- OnError(line);
+ onError(line);
return;
}
}
@@ -291,7 +288,7 @@ void MatchLine(string line)
keepAlive = false;
}
- if (OnOutput != null) OnOutput(line);
+ OnOutput?.Invoke(line);
}
#endregion
}
diff --git a/External/Plugins/AS3Context/Compiler/FlexDebugger.cs b/External/Plugins/AS3Context/Compiler/FlexDebugger.cs
index d73def73df..4f237848b3 100644
--- a/External/Plugins/AS3Context/Compiler/FlexDebugger.cs
+++ b/External/Plugins/AS3Context/Compiler/FlexDebugger.cs
@@ -1,11 +1,6 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
using PluginCore;
-using System.Windows.Forms;
-using PluginCore.Managers;
-using System.IO;
using PluginCore.Localization;
+using PluginCore.Managers;
namespace AS3Context.Compiler
{
@@ -18,14 +13,14 @@ public static bool Start(string projectPath, string flex2Path, DataEvent message
if (ignoreMessage) return false;
try
{
- if (debugger != null) debugger.Cleanup();
+ debugger?.Cleanup();
startMessage = message;
debugger = new FdbWrapper();
- debugger.OnStarted += new LineEvent(debugger_OnStarted);
- debugger.OnTrace += new LineEvent(debugger_OnTrace);
- debugger.OnError += new LineEvent(debugger_OnError);
+ debugger.OnStarted += debugger_OnStarted;
+ debugger.OnTrace += debugger_OnTrace;
+ debugger.OnError += debugger_OnError;
if (PluginMain.Settings.VerboseFDB)
- debugger.OnOutput += new LineEvent(debugger_OnOutput);
+ debugger.OnOutput += debugger_OnOutput;
debugger.Run(projectPath, flex2Path);
TraceManager.AddAsync(TextHelper.GetString("Info.CapturingTracesWithFDB"));
return true;
@@ -50,15 +45,14 @@ public static void Stop()
#endregion
- static private bool ignoreMessage;
- static private FdbWrapper debugger;
- static private DataEvent startMessage;
+ static bool ignoreMessage;
+ static FdbWrapper debugger;
+ static DataEvent startMessage;
static void debugger_OnStarted(string line)
{
- if (startMessage == null)
- return;
- PluginBase.RunAsync((MethodInvoker)delegate
+ if (startMessage is null) return;
+ PluginBase.RunAsync(delegate
{
// send message again
ignoreMessage = true;
@@ -68,19 +62,10 @@ static void debugger_OnStarted(string line)
});
}
- static void debugger_OnError(string line)
- {
- TraceManager.AddAsync(line, 3);
- }
+ static void debugger_OnError(string line) => TraceManager.AddAsync(line, 3);
- static void debugger_OnOutput(string line)
- {
- TraceManager.AddAsync(line, 1);
- }
+ static void debugger_OnOutput(string line) => TraceManager.AddAsync(line, 1);
- static void debugger_OnTrace(string line)
- {
- TraceManager.AddAsync(line, 1);
- }
+ static void debugger_OnTrace(string line) => TraceManager.AddAsync(line, 1);
}
}
diff --git a/External/Plugins/AS3Context/Compiler/FlexShells.cs b/External/Plugins/AS3Context/Compiler/FlexShells.cs
index 9378f818e5..58c8e7527c 100644
--- a/External/Plugins/AS3Context/Compiler/FlexShells.cs
+++ b/External/Plugins/AS3Context/Compiler/FlexShells.cs
@@ -1,122 +1,101 @@
using System;
-using System.Windows.Forms;
+using System.Collections;
+using System.Collections.Generic;
+using System.Diagnostics;
using System.IO;
-using System.Text;
+using System.Reflection;
using System.Text.RegularExpressions;
using System.Threading;
-using System.Diagnostics;
-using System.Timers;
-using System.Runtime.InteropServices;
+using System.Windows.Forms;
+using ASCompletion.Context;
+using ASCompletion.Model;
using PluginCore;
using PluginCore.Helpers;
-using ASCompletion.Context;
+using PluginCore.Localization;
using PluginCore.Managers;
using PluginCore.Utilities;
-using PluginCore.Localization;
-using ASCompletion.Model;
-using System.Collections;
-using System.Collections.Generic;
namespace AS3Context.Compiler
{
public delegate void SyntaxErrorHandler(string error);
- ///
- /// Wrappers for Flex SDK integration
- ///
- public class FlexShells
- {
- static public event SyntaxErrorHandler SyntaxError;
-
- static readonly public Regex re_SplitParams =
- new Regex("[\\s](?\\-[A-z0-9\\-\\.]+)", RegexOptions.Compiled | RegexOptions.Singleline);
-
- static private readonly string[] PATH_SWITCHES = {
- "-compiler.context-root","-context-root",
- "-compiler.defaults-css-url","-defaults-css-url",
- "-compiler.external-library-path","-external-library-path","-el",
- "-compiler.fonts.system-search-path","-system-search-path",
- "-compiler.include-libraries","-include-libraries",
- "-compiler.library-path","-library-path","-l",
- "-compiler.source-path","-source-path","-sp",
- "-compiler.services","-services",
- "-compiler.theme","-theme",
- "-dump-config","-file-specs","resource-bundle-list",
- "-link-report","-load-config","-load-externs","-size-report",
- "-output","-o","-runtime-shared-libraries","-rsl",
+ ///
+ /// Wrappers for Flex SDK integration
+ ///
+ public class FlexShells
+ {
+ public static event SyntaxErrorHandler SyntaxError;
+
+ public static readonly Regex re_SplitParams =
+ new Regex("[\\s](?[-+][A-z0-9\\-\\.]+)", RegexOptions.Compiled | RegexOptions.Singleline);
+
+ static readonly string[] PATH_SWITCHES = {
+ "-compiler.context-root","-context-root",
+ "-compiler.defaults-css-url","-defaults-css-url",
+ "-compiler.external-library-path","-external-library-path","-el",
+ "-compiler.fonts.system-search-path","-system-search-path",
+ "-compiler.include-libraries","-include-libraries",
+ "-compiler.library-path","-library-path","-l",
+ "-compiler.source-path","-source-path","-sp",
+ "-compiler.services","-services",
+ "-compiler.theme","-theme",
+ "-dump-config","-file-specs","resource-bundle-list",
+ "-link-report","-load-config","-load-externs","-size-report",
+ "-output","-o","-runtime-shared-libraries","-rsl",
"-namespace","-compiler.namespaces.namespace"};
-
- static private string ascPath;
- static private string mxmlcPath;
- static private string flexShellsJar = "Flex4Shells.jar";
- static private string flexShellsPath;
- static private bool running;
- static private bool silentChecking;
- static private string checkedSDK;
- static private bool isFlex4SDK;
- static private string currentSDK;
-
- static private string CheckResource(string resName, string fileName)
- {
- string path = Path.Combine(PathHelper.DataDir, "AS3Context");
- string fullPath = Path.Combine(path, fileName);
- if (!File.Exists(fullPath))
- {
- string id = "AS3Context.Resources." + resName;
- System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
- using (BinaryReader br = new BinaryReader(assembly.GetManifestResourceStream(id)))
- {
- using (FileStream bw = File.Create(fullPath))
- {
- byte[] buffer = br.ReadBytes(1024);
- while (buffer.Length > 0)
- {
- bw.Write(buffer, 0, buffer.Length);
- buffer = br.ReadBytes(1024);
- }
- bw.Close();
- }
- br.Close();
- }
- }
+
+ static string ascPath;
+ static string mxmlcPath;
+ static readonly string flexShellsJar = "Flex4Shells.jar";
+ static string flexShellsPath;
+ static bool running;
+ static bool silentChecking;
+ static string checkedSDK;
+ static bool isFlex4SDK;
+ static string currentSDK;
+
+ static string CheckResource(string resName, string fileName)
+ {
+ var fullPath = Path.Combine(PathHelper.DataDir, "AS3Context", fileName);
+ if (File.Exists(fullPath)) return fullPath;
+ var id = "AS3Context.Resources." + resName;
+ var assembly = Assembly.GetExecutingAssembly();
+ using var br = new BinaryReader(assembly.GetManifestResourceStream(id));
+ using var bw = File.Create(fullPath);
+ var buffer = br.ReadBytes(1024);
+ while (buffer.Length > 0)
+ {
+ bw.Write(buffer, 0, buffer.Length);
+ buffer = br.ReadBytes(1024);
+ }
+ bw.Close();
+ br.Close();
return fullPath;
- }
-
- static public FlexShells Instance
- {
- get {
- if (instance == null) instance = new FlexShells();
- return instance;
- }
- }
-
- static private FlexShells instance;
-
- private FlexShells()
- {
- }
-
- private ProcessRunner ascRunner;
- private ProcessRunner mxmlcRunner;
- private string builtSWF;
- private bool debugMode;
- private Dictionary jvmConfig;
-
- public void CheckAS3(string filename, string flexPath)
+ }
+
+ public static FlexShells Instance => instance ??= new FlexShells();
+
+ static FlexShells instance;
+
+ FlexShells()
{
- CheckAS3(filename, flexPath, null);
}
+ ProcessRunner ascRunner;
+ ProcessRunner mxmlcRunner;
+ string builtSWF;
+ bool debugMode;
+ Dictionary jvmConfig;
+
+ public void CheckAS3(string filename, string flexPath) => CheckAS3(filename, flexPath, null);
+
public void CheckAS3(string filename, string flexPath, string src)
- {
+ {
if (running) return;
// let other plugins preprocess source/handle checking
- Hashtable data = new Hashtable();
- data["filename"] = filename;
- data["src"] = src;
- data["ext"] = Path.GetExtension(filename);
- DataEvent de = new DataEvent(EventType.Command, "AS3Context.CheckSyntax", data);
+ var data = new Hashtable {["filename"] = filename, ["src"] = src, ["ext"] = Path.GetExtension(filename)};
+ var de = new DataEvent(EventType.Command, "AS3Context.CheckSyntax", data);
EventManager.DispatchEvent(this, de);
if (de.Handled) return;
@@ -126,29 +105,27 @@ public void CheckAS3(string filename, string flexPath, string src)
return;
string basePath = null;
- if (PluginBase.CurrentProject != null)
- basePath = Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath);
+ if (PluginBase.CurrentProject != null) basePath = Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath);
flexPath = PathHelper.ResolvePath(flexPath, basePath);
// asc.jar in FlexSDK
if (flexPath != null && Directory.Exists(Path.Combine(flexPath, "lib")))
ascPath = Path.Combine(flexPath, "lib\\asc.jar");
// included asc.jar
- if (ascPath == null || !File.Exists(ascPath))
- ascPath = PathHelper.ResolvePath(Path.Combine(PathHelper.ToolDir, "flexlibs/lib/asc.jar"));
-
- if (ascPath == null)
+ if (!File.Exists(ascPath)) ascPath = PathHelper.ResolvePath(Path.Combine(PathHelper.ToolDir, "flexlibs/lib/asc.jar"));
+ if (ascPath is null)
{
if (src != null) return; // silent checking
- DialogResult result = MessageBox.Show(TextHelper.GetString("Info.SetFlex2OrCS3Path"), TextHelper.GetString("Title.ConfigurationRequired"), MessageBoxButtons.YesNoCancel);
- if (result == DialogResult.Yes)
- {
- IASContext context = ASContext.GetLanguageContext("as3");
- if (context == null) return;
- PluginBase.MainForm.ShowSettingsDialog("AS3Context", "SDK");
- }
- else if (result == DialogResult.No)
+ var result = MessageBox.Show(TextHelper.GetString("Info.SetFlex2OrCS3Path"), TextHelper.GetString("Title.ConfigurationRequired"), MessageBoxButtons.YesNoCancel);
+ switch (result)
{
- PluginBase.MainForm.ShowSettingsDialog("ASCompletion", "Flash");
+ case DialogResult.Yes:
+ var context = ASContext.GetLanguageContext("as3");
+ if (context is null) return;
+ PluginBase.MainForm.ShowSettingsDialog("AS3Context", "SDK");
+ break;
+ case DialogResult.No:
+ PluginBase.MainForm.ShowSettingsDialog("ASCompletion", "Flash");
+ break;
}
return;
}
@@ -162,16 +139,14 @@ public void CheckAS3(string filename, string flexPath, string src)
}
jvmConfig = JvmConfigHelper.ReadConfig(flexPath);
-
- try
- {
+
+ try
+ {
running = true;
- if (src == null) EventManager.DispatchEvent(this, new NotifyEvent(EventType.ProcessStart));
- if (ascRunner == null || !ascRunner.IsRunning || currentSDK != flexPath)
- StartAscRunner(flexPath);
-
- notificationSent = false;
- if (src == null)
+ if (src is null) EventManager.DispatchEvent(this, new NotifyEvent(EventType.ProcessStart));
+ if (ascRunner is null || !ascRunner.IsRunning || currentSDK != flexPath) StartAscRunner(flexPath);
+ notificationSent = false;
+ if (src is null)
{
silentChecking = false;
//TraceManager.Add("Checking: " + filename, -1);
@@ -185,37 +160,31 @@ public void CheckAS3(string filename, string flexPath, string src)
ascRunner.HostedProcess.StandardInput.WriteLine(src);
ascRunner.HostedProcess.StandardInput.WriteLine(filename + "$raw$");
}
- }
- catch(Exception ex)
- {
+ }
+ catch(Exception ex)
+ {
ErrorManager.AddToLog(TextHelper.GetString("Info.CheckError"), ex);
TraceManager.AddAsync(TextHelper.GetString("Info.CheckError") + "\n" + ex.Message);
- }
- }
+ }
+ }
public void RunMxmlc(string cmd, string flexPath)
- {
+ {
if (running) return;
string basePath = null;
- if (PluginBase.CurrentProject != null)
- basePath = Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath);
+ if (PluginBase.CurrentProject != null) basePath = Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath);
flexPath = PathHelper.ResolvePath(flexPath, basePath);
- if (flexPath != null && Directory.Exists(flexPath))
+ if (Directory.Exists(flexPath)) mxmlcPath = Path.Combine(flexPath, "lib", "mxmlc.jar");
+ if (!File.Exists(mxmlcPath))
{
- mxmlcPath = Path.Combine(Path.Combine(flexPath, "lib"), "mxmlc.jar");
+ var result = MessageBox.Show(TextHelper.GetString("Info.OpenCompilerSettings"), TextHelper.GetString("Title.ConfigurationRequired"), MessageBoxButtons.OKCancel);
+ if (result != DialogResult.OK) return;
+ var context = ASContext.GetLanguageContext("as3");
+ if (context is null) return;
+ PluginBase.MainForm.ShowSettingsDialog("AS3Context", "SDK");
+ return;
}
- if (mxmlcPath == null || !File.Exists(mxmlcPath))
- {
- DialogResult result = MessageBox.Show(TextHelper.GetString("Info.OpenCompilerSettings"), TextHelper.GetString("Title.ConfigurationRequired"), MessageBoxButtons.OKCancel);
- if (result == DialogResult.OK)
- {
- IASContext context = ASContext.GetLanguageContext("as3");
- if (context == null) return;
- PluginBase.MainForm.ShowSettingsDialog("AS3Context", "SDK");
- }
- return;
- }
flexShellsPath = CheckResource("FlexShells.jar", flexShellsJar);
if (!File.Exists(flexShellsPath))
@@ -225,68 +194,65 @@ public void RunMxmlc(string cmd, string flexPath)
}
jvmConfig = JvmConfigHelper.ReadConfig(flexPath);
-
- try
- {
+
+ try
+ {
running = true;
- EventManager.DispatchEvent(this, new NotifyEvent(EventType.ProcessStart));
+ EventManager.DispatchEvent(this, new NotifyEvent(EventType.ProcessStart));
- if (mxmlcRunner == null || !mxmlcRunner.IsRunning || currentSDK != flexPath)
+ if (mxmlcRunner is null || !mxmlcRunner.IsRunning || currentSDK != flexPath)
StartMxmlcRunner(flexPath);
-
- //cmd = mainForm.ProcessArgString(cmd);
- //TraceManager.Add("MxmlcShell command: "+cmd, -1);
+
+ //cmd = mainForm.ProcessArgString(cmd);
+ //TraceManager.Add("MxmlcShell command: "+cmd, -1);
ASContext.SetStatusText(TextHelper.GetString("Info.MxmlcRunning"));
- notificationSent = false;
- mxmlcRunner.HostedProcess.StandardInput.WriteLine(cmd);
- }
- catch(Exception ex)
- {
- ErrorManager.ShowError(ex);
- }
- }
+ notificationSent = false;
+ mxmlcRunner.HostedProcess.StandardInput.WriteLine(cmd);
+ }
+ catch(Exception ex)
+ {
+ ErrorManager.ShowError(ex);
+ }
+ }
public void QuickBuild(FileModel theFile, string flex2Path, bool requireTag, bool playAfterBuild)
- {
+ {
if (running) return;
- // environment
+ // environment
string filename = theFile.FileName;
string currentPath = Environment.CurrentDirectory;
string buildPath = PluginBase.MainForm.ProcessArgString("$(ProjectDir)");
- if (!Directory.Exists(buildPath)
+ if (!Directory.Exists(buildPath)
|| !filename.StartsWith(buildPath, StringComparison.OrdinalIgnoreCase))
- {
+ {
buildPath = theFile.BasePath;
if (!Directory.Exists(buildPath))
- buildPath = Path.GetDirectoryName(filename);
- }
- // command
+ buildPath = Path.GetDirectoryName(filename);
+ }
+ // command
debugMode = false;
- bool hasOutput = false;
- string cmd = "";
- Match mCmd = Regex.Match(PluginBase.MainForm.CurrentDocument.SciControl.Text, "\\s@mxmlc\\s(?.*)");
+ var hasOutput = false;
+ var cmd = "";
+ var mCmd = Regex.Match(PluginBase.MainForm.CurrentDocument?.SciControl.Text, "\\s@mxmlc\\s(?.*)");
if (mCmd.Success)
{
try
{
-
// cleanup tag
- string tag = mCmd.Groups["cmd"].Value;
- if (tag.IndexOf("-->") > 0) tag = tag.Substring(0, tag.IndexOf("-->"));
- if (tag.IndexOf("]]>") > 0) tag = tag.Substring(0, tag.IndexOf("]]>"));
+ var tag = mCmd.Groups["cmd"].Value;
+ if (tag.IndexOfOrdinal("-->") > 0) tag = tag.Substring(0, tag.IndexOfOrdinal("-->"));
+ if (tag.IndexOfOrdinal("]]>") > 0) tag = tag.Substring(0, tag.IndexOfOrdinal("]]>"));
tag = " " + tag.Trim() + " --";
// split
- MatchCollection mPar = re_SplitParams.Matches(tag);
+ var mPar = re_SplitParams.Matches(tag);
if (mPar.Count > 0)
{
cmd = "";
- string op;
- string arg;
for (int i = 0; i < mPar.Count; i++)
{
- op = mPar[i].Groups["switch"].Value;
+ var op = mPar[i].Groups["switch"].Value;
if (op == "--") break;
if (op == "-noplay")
{
@@ -300,8 +266,8 @@ public void QuickBuild(FileModel theFile, string flex2Path, bool requireTag, boo
if (end > start)
{
string concat = ";";
- arg = tag.Substring(start, end - start).Trim();
- if (arg.StartsWith("+=") || arg.StartsWith("="))
+ var arg = tag.Substring(start, end - start).Trim();
+ if (arg.StartsWithOrdinal("+=") || arg.StartsWith('='))
{
concat = arg.Substring(0, arg.IndexOf('=') + 1);
arg = arg.Substring(concat.Length);
@@ -311,7 +277,7 @@ public void QuickBuild(FileModel theFile, string flex2Path, bool requireTag, boo
{
if (pswitch == op)
{
- if (op.EndsWith("namespace"))
+ if (op.EndsWithOrdinal("namespace"))
{
int sp = arg.IndexOf(' ');
if (sp > 0)
@@ -321,7 +287,11 @@ public void QuickBuild(FileModel theFile, string flex2Path, bool requireTag, boo
}
}
isPath = true;
- if (!arg.StartsWith("\\") && !Path.IsPathRooted(arg))
+ // remove quotes
+ if (arg.StartsWith('\"') && arg.EndsWith('\"'))
+ arg = arg.Substring(1, arg.Length - 2);
+
+ if (!arg.StartsWith('\\') && !Path.IsPathRooted(arg))
arg = Path.Combine(buildPath, arg);
}
}
@@ -330,7 +300,7 @@ public void QuickBuild(FileModel theFile, string flex2Path, bool requireTag, boo
builtSWF = arg;
hasOutput = true;
}
- if (!isPath) arg = arg.Replace(" ", ";");
+ if (!isPath) arg = arg.Replace(' ', ';');
cmd += op + concat + arg + ";";
}
else cmd += op + ";";
@@ -345,13 +315,13 @@ public void QuickBuild(FileModel theFile, string flex2Path, bool requireTag, boo
else if (requireTag) return;
// Flex4 static linking
- if (isFlex4SDK && cmd.IndexOf("-static-link-runtime-shared-libraries") < 0)
+ if (isFlex4SDK && !cmd.Contains("-static-link-runtime-shared-libraries"))
cmd += ";-static-link-runtime-shared-libraries=true";
// add current class sourcepath and global classpaths
cmd += ";-sp+=" + theFile.BasePath;
- if (Context.Context.Settings.UserClasspath != null)
- foreach (string cp in Context.Context.Settings.UserClasspath)
+ if (ASContext.Context.Settings.UserClasspath != null)
+ foreach (string cp in ASContext.Context.Settings.UserClasspath)
cmd += ";-sp+=" + cp;
// add output filename
if (!hasOutput)
@@ -363,15 +333,15 @@ public void QuickBuild(FileModel theFile, string flex2Path, bool requireTag, boo
cmd += ";--;" + filename;
// build
- cmd = cmd.Replace(";;", ";");
+ cmd = cmd.Replace(";;", ";");
RunMxmlc(cmd, flex2Path);
- if (!playAfterBuild) builtSWF = null;
-
- // restaure working directory
- Environment.CurrentDirectory = currentPath;
+ if (!playAfterBuild) builtSWF = null;
+
+ // restaure working directory
+ Environment.CurrentDirectory = currentPath;
}
- private void CheckIsFlex4SDK(string flexPath)
+ void CheckIsFlex4SDK(string flexPath)
{
if (checkedSDK == flexPath) return;
checkedSDK = flexPath;
@@ -380,7 +350,7 @@ private void CheckIsFlex4SDK(string flexPath)
if (File.Exists(flexDesc))
{
string src = File.ReadAllText(flexDesc);
- isFlex4SDK = src.IndexOf("4") > 0;
+ isFlex4SDK = src.IndexOfOrdinal("4") > 0;
}
else isFlex4SDK = false;
}
@@ -388,30 +358,44 @@ private void CheckIsFlex4SDK(string flexPath)
#region Background process
///
- /// Stop background processes
- ///
- public void Stop()
- {
- if (ascRunner != null && ascRunner.IsRunning) ascRunner.KillProcess();
- ascRunner = null;
- if (mxmlcRunner != null && mxmlcRunner.IsRunning) mxmlcRunner.KillProcess();
- mxmlcRunner = null;
- }
-
- ///
- /// Start background process
- ///
- private void StartAscRunner(string flexPath)
- {
+ /// Stop background processes
+ ///
+ public void Stop()
+ {
+ try
+ {
+ if (ascRunner != null && ascRunner.IsRunning) ascRunner.KillProcess();
+ }
+ catch { }
+ finally
+ {
+ ascRunner = null;
+ }
+ try
+ {
+ if (mxmlcRunner != null && mxmlcRunner.IsRunning) mxmlcRunner.KillProcess();
+ }
+ catch { }
+ finally
+ {
+ mxmlcRunner = null;
+ }
+ }
+
+ ///
+ /// Start background process
+ ///
+ void StartAscRunner(string flexPath)
+ {
currentSDK = flexPath;
if (ascRunner != null && ascRunner.IsRunning) ascRunner.KillProcess();
- string cmd = "-Duser.language=en -Duser.region=US"
+ string cmd = jvmConfig["java.args"]
+ " -classpath \"" + ascPath + ";" + flexShellsPath + "\" AscShell";
TraceManager.Add(TextHelper.GetString("Info.StartAscRunner") + "\n"
- + JvmConfigHelper.GetJavaEXE(jvmConfig) + " " + cmd, -1);
- // run asc shell
- ascRunner = new ProcessRunner();
+ + JvmConfigHelper.GetJavaEXE(jvmConfig) + " " + cmd, 0);
+ // run asc shell
+ ascRunner = new ProcessRunner();
ascRunner.WorkingDirectory = Path.GetDirectoryName(ascPath);
ascRunner.RedirectInput = true;
ascRunner.Run(JvmConfigHelper.GetJavaEXE(jvmConfig), cmd, true);
@@ -419,13 +403,13 @@ private void StartAscRunner(string flexPath)
ascRunner.Error += ascRunner_Error;
errorState = 0;
Thread.Sleep(100);
- }
-
- ///
- /// Start background process
- ///
- private void StartMxmlcRunner(string flexPath)
- {
+ }
+
+ ///
+ /// Start background process
+ ///
+ void StartMxmlcRunner(string flexPath)
+ {
currentSDK = flexPath;
if (mxmlcRunner != null && mxmlcRunner.IsRunning) mxmlcRunner.KillProcess();
@@ -436,7 +420,7 @@ private void StartMxmlcRunner(string flexPath)
+ " -classpath \"" + mxmlcPath + ";" + flexShellsPath + "\" " + shell;
TraceManager.Add(TextHelper.GetString("Info.StartMxmlcRunner") + "\n"
+ JvmConfigHelper.GetJavaEXE(jvmConfig) + " " + cmd, -1);
- // run compiler shell
+ // run compiler shell
mxmlcRunner = new ProcessRunner();
mxmlcRunner.WorkingDirectory = Path.Combine(flexPath, "frameworks");
mxmlcRunner.RedirectInput = true;
@@ -451,13 +435,13 @@ private void StartMxmlcRunner(string flexPath)
#region process output capture
- private int errorState;
- private string errorDesc;
- private bool notificationSent;
+ int errorState;
+ string errorDesc;
+ bool notificationSent;
- private void ascRunner_Error(object sender, string line)
+ void ascRunner_Error(object sender, string line)
{
- if (line.StartsWith("[Compiler] Error"))
+ if (line.StartsWithOrdinal("[Compiler] Error"))
{
errorState = 1;
errorDesc = line.Substring(10);
@@ -465,64 +449,60 @@ private void ascRunner_Error(object sender, string line)
else if (errorState == 1)
{
line = line.Trim();
- Match mErr = Regex.Match(line, @"(?[^,]+), Ln (?[0-9]+), Col (? [0-9]+)");
+ var mErr = Regex.Match(line, @"(?[^,]+), Ln (?[0-9]+), Col (? [0-9]+)");
if (mErr.Success)
{
- string filename = mErr.Groups["file"].Value;
- try
- {
- if (File.Exists(filename))
- {
- StringBuilder sb = new StringBuilder(1024);
- GetLongPathName(filename, sb, (uint)1024);
- filename = sb.ToString();
- }
- }
- catch {}
- errorDesc = String.Format("{0}:{1}: col: {2}: {3}", filename, mErr.Groups["line"].Value, mErr.Groups["col"].Value, errorDesc);
+ var filename = mErr.Groups["file"].Value;
+ try
+ {
+ if (File.Exists(filename))
+ {
+ filename = PathHelper.GetLongPathName(filename);
+ }
+ }
+ catch {}
+ errorDesc = $"{filename}:{mErr.Groups["line"].Value}: col: {mErr.Groups["col"].Value}: {errorDesc}";
ascRunner_OutputError(sender, errorDesc);
}
errorState++;
}
else if (errorState > 0)
{
- if (line.IndexOf("error found") > 0) errorState = 0;
+ if (line.IndexOfOrdinal("error found") > 0) errorState = 0;
}
else if (line.Trim().Length > 0) ascRunner_OutputError(sender, line);
}
-
- private void ascRunner_OutputError(object sender, string line)
+
+ void ascRunner_OutputError(object sender, string line)
{
- if (line == null) return;
- PluginBase.RunAsync((MethodInvoker)delegate
+ if (line is null) return;
+ PluginBase.RunAsync(delegate
{
- if (line.StartsWith("Exception "))
+ if (line.StartsWithOrdinal("Exception "))
{
TraceManager.AddAsync(line, -3);
return;
}
if (silentChecking)
{
- if (SyntaxError != null) SyntaxError(line);
+ SyntaxError?.Invoke(line);
return;
}
TraceManager.Add(line, -3);
- if (!notificationSent)
- {
- notificationSent = true;
- TraceManager.Add("Done(1)", -2);
- EventManager.DispatchEvent(this, new TextEvent(EventType.ProcessEnd, "Done(1)"));
- ASContext.SetStatusText(TextHelper.GetString("Info.AscDone"));
- EventManager.DispatchEvent(this, new DataEvent(EventType.Command, "ResultsPanel.ShowResults", null));
- }
+ if (notificationSent) return;
+ notificationSent = true;
+ TraceManager.Add("Done(1)", -2);
+ EventManager.DispatchEvent(this, new TextEvent(EventType.ProcessEnd, "Done(1)"));
+ ASContext.SetStatusText(TextHelper.GetString("Info.AscDone"));
+ EventManager.DispatchEvent(this, new DataEvent(EventType.Command, "ResultsPanel.ShowResults", null));
});
}
- private void ascRunner_Output(object sender, string line)
+ void ascRunner_Output(object sender, string line)
{
- if (line.StartsWith("(ash)"))
+ if (line.StartsWithOrdinal("(ash)"))
{
- if (line.IndexOf("Done") > 0)
+ if (line.IndexOfOrdinal("Done") > 0)
{
running = false;
if (!silentChecking && !notificationSent)
@@ -537,21 +517,21 @@ private void ascRunner_Output(object sender, string line)
if (!silentChecking) TraceManager.AddAsync(line, 0);
}
- private void ascRunner_End()
+ static void ascRunner_End()
{
TraceManager.AddAsync("Done(0)", -2);
}
-
- private void mxmlcRunner_Error(object sender, string line)
+
+ static void mxmlcRunner_Error(object sender, string line)
{
TraceManager.AddAsync(line, -3);
}
- private void mxmlcRunner_Output(object sender, string line)
+ void mxmlcRunner_Output(object sender, string line)
{
- PluginBase.RunAsync((MethodInvoker)delegate
+ PluginBase.RunAsync(delegate
{
- if (!notificationSent && line.StartsWith("Done("))
+ if (!notificationSent && line.StartsWithOrdinal("Done("))
{
running = false;
TraceManager.Add(line, -2);
@@ -567,16 +547,16 @@ private void mxmlcRunner_Output(object sender, string line)
else TraceManager.Add(line, 0);
});
}
-
- private void RunAfterBuild()
+
+ void RunAfterBuild()
{
- if (builtSWF == null || !File.Exists(builtSWF))
+ if (!File.Exists(builtSWF))
{
debugMode = false;
return;
}
- string swf = builtSWF;
- builtSWF = null;
+ string swf = builtSWF;
+ builtSWF = null;
// debugger
if (debugMode)
@@ -585,44 +565,27 @@ private void RunAfterBuild()
EventManager.DispatchEvent(this, de);
}
- // other plugin may handle the SWF playing
+ // other plugin may handle the SWF playing
DataEvent dePlay = new DataEvent(EventType.Command, "FlashViewer.Default", swf);
EventManager.DispatchEvent(this, dePlay);
- if (dePlay.Handled) return;
-
- try
- {
- // change current directory
- string currentPath = System.IO.Directory.GetCurrentDirectory();
- System.IO.Directory.SetCurrentDirectory(Path.GetDirectoryName(swf));
- // run
- System.Diagnostics.Process.Start(swf);
- // restaure current directory
- System.IO.Directory.SetCurrentDirectory(currentPath);
- }
- catch (Exception ex)
- {
- ErrorManager.ShowError(ex.Message, ex);
- }
+ if (dePlay.Handled) return;
+
+ try
+ {
+ // change current directory
+ string currentPath = Directory.GetCurrentDirectory();
+ Directory.SetCurrentDirectory(Path.GetDirectoryName(swf));
+ // run
+ Process.Start(swf);
+ // restaure current directory
+ Directory.SetCurrentDirectory(currentPath);
+ }
+ catch (Exception ex)
+ {
+ ErrorManager.ShowError(ex.Message, ex);
+ }
}
#endregion
- #region Win32
-
- [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError=true)]
- static extern uint GetShortPathName(
- [MarshalAs(UnmanagedType.LPTStr)]
- string lpszLongPath,
- [MarshalAs(UnmanagedType.LPTStr)]
- StringBuilder lpszShortPath,
- uint cchBuffer);
-
- [DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Auto)]
- static extern uint GetLongPathName(
- string lpszShortPath,
- [Out] StringBuilder lpszLongPath,
- uint cchBuffer);
-
- #endregion
}
}
diff --git a/External/Plugins/AS3Context/Completion/CodeComplete.cs b/External/Plugins/AS3Context/Completion/CodeComplete.cs
new file mode 100644
index 0000000000..af864d440f
--- /dev/null
+++ b/External/Plugins/AS3Context/Completion/CodeComplete.cs
@@ -0,0 +1,176 @@
+using System.Collections.Generic;
+using System.Linq;
+using ASCompletion.Completion;
+using ASCompletion.Context;
+using ASCompletion.Model;
+using PluginCore;
+using ScintillaNet;
+
+namespace AS3Context.Completion
+{
+ class CodeComplete : ASComplete
+ {
+ ///
+ protected override ASResult EvalExpression(string expression, ASExpr context, FileModel inFile, ClassModel inClass, bool complete, bool asFunction, bool filterVisibility)
+ {
+ if (!string.IsNullOrEmpty(expression))
+ {
+ var ctx = ASContext.Context;
+ var features = ctx.Features;
+ // for example: 1.0., 5e-324.
+ if (char.IsDigit(expression, 0)
+ // for example: -1.
+ || (expression.Length > 1 && expression[0] == '-' && char.IsDigit(expression, 1))
+ // for example: --1.
+ || (expression.Length > 2 && expression[0] == '-' && expression[1] == '-' &&
+ char.IsDigit(expression, 2)))
+ {
+ int p;
+ var pe2 = -1;
+ if (expression.Contains("e-", out var pe1) || expression.Contains("e+", out pe2))
+ {
+ p = expression.IndexOf('.');
+ if (p == -1) p = expression.Length - 1;
+ else if (p < pe1 || p < pe2)
+ {
+ var p2 = expression.IndexOf('.', p + 1);
+ p = p2 != -1 ? p2 : expression.Length - 1;
+ }
+ }
+ else
+ {
+ p = expression.IndexOf('.');
+ if (p == expression.Length - 1) p = -1;
+ else if (p != -1)
+ {
+ // for example: 1.0.
+ if (char.IsDigit(expression[p + 1]))
+ {
+ var p2 = expression.IndexOf('.', p + 1);
+ p = p2 != -1 ? p2 : expression.Length - 1;
+ }
+ // for example: -1.valueOf().
+ else p = -1;
+ }
+ }
+
+ if (p != -1)
+ {
+ expression = "Number.#." + expression.Substring(p + 1);
+ return base.EvalExpression(expression, context, inFile, inClass, complete, asFunction,
+ filterVisibility);
+ }
+ }
+
+ if (context.SubExpressions != null)
+ {
+ var count = context.SubExpressions.Count - 1;
+ // transform #2~.#1~.#0~ to #2~.[].[]
+ for (var i = 0; i <= count; i++)
+ {
+ var subExpression = context.SubExpressions[i];
+ if (subExpression.Length < 2 || subExpression[0] != '[') continue;
+ // for example: [].
+ if (expression[0] == '#' && i == count)
+ {
+ var type = ResolveType(features.arrayKey, inFile);
+ if (type.IsVoid()) break;
+ expression = type.Name + ".#" + expression.Substring(("#" + i + "~").Length);
+ context.SubExpressions.RemoveAt(i);
+ return base.EvalExpression(expression, context, inFile, inClass, complete, asFunction,
+ filterVisibility);
+ }
+
+ expression = expression.Replace(">.#" + i + "~", ">" + subExpression);
+ expression = expression.Replace(".#" + i + "~", "." + subExpression);
+ }
+ }
+
+ if (expression.Length > 1 && expression[0] is { } c && (c == '"' || c == '\''))
+ {
+ var type = ResolveType(features.stringKey, inFile);
+ // for example: ""|, ''|
+ if (context.SubExpressions is null) expression = type.Name + ".#.";
+ // for example: ""., ''.
+ else
+ {
+ var pattern = c + ".#" + (context.SubExpressions.Count - 1) + "~";
+ var startIndex = expression.IndexOfOrdinal(pattern) + pattern.Length;
+ expression = type.Name + ".#" + expression.Substring(startIndex);
+ }
+ }
+ // for example: new [].
+ else if (expression.Contains(">.[")) expression = expression.Replace(">.[", ">[");
+ // transform Vector. to Vector
+ else if (expression.Contains(".<")) expression = expression.Replace(".<", "<");
+ // for example: /pattern/.
+ else if (expression.StartsWithOrdinal("#RegExp")) expression = expression.Substring(1);
+ else if (!context.SubExpressions.IsNullOrEmpty())
+ {
+ var expr = context.SubExpressions.Last();
+ // for example: (v as T)., (v is Complete)., ...
+ if (expr.Length >= 8 /*"(v as T)".Length*/ && expr[0] == '(')
+ {
+ var type = ctx.ResolveToken(expr, inFile);
+ if (!type.IsVoid())
+ {
+ expression = type.Name + ".#" +
+ expression.Substring(("#" + (context.SubExpressions.Count - 1) + "~").Length);
+ context.SubExpressions.RemoveAt(context.SubExpressions.Count - 1);
+ if (context.SubExpressions.Count == 0) context.SubExpressions = null;
+ }
+ }
+ }
+ }
+
+ return base.EvalExpression(expression, context, inFile, inClass, complete, asFunction, filterVisibility);
+ }
+
+ ///
+ protected override bool HandleNewCompletion(ScintillaControl sci, string tail, bool autoHide, string keyword, List list)
+ {
+ if (keyword == "new") list.RemoveAll(it => it is MemberItem {Member: { } member} && (member.Flags & FlagType.Interface) != 0);
+ return base.HandleNewCompletion(sci, tail, autoHide, keyword, list);
+ }
+
+ ///
+ protected override bool IsAvailableForToolTip(ScintillaControl sci, int position)
+ {
+ return base.IsAvailableForToolTip(sci, position)
+ || (sci.GetWordFromPosition(position) is { } word
+ && (word == "as" || word == "is" || word == "instanceof" || word == "typeof" || word == "delete"));
+ }
+
+ ///
+ protected override string GetToolTipTextEx(ASResult expr)
+ {
+ if (expr.Member is null && expr.Context?.Value is {} s)
+ {
+ switch (s)
+ {
+ // for example: variable as$(EntryPoint) Type
+ case "as":
+ expr.Member = Context.StubAsExpression;
+ break;
+ // for example: variable is$(EntryPoint) Type
+ case "is":
+ expr.Member = Context.StubIsExpression;
+ break;
+ // for example: variable instanceof$(EntryPoint) function
+ case "instanceof":
+ expr.Member = Context.StubInstanceOfExpression;
+ break;
+ // for example: typeof(EntryPoint) expression
+ case "typeof":
+ expr.Member = Context.StubTypeOfExpression;
+ break;
+ // for example: delete$(EntryPoint) reference
+ case "delete":
+ expr.Member = Context.StubDeleteExpression;
+ break;
+ }
+ }
+ return base.GetToolTipTextEx(expr);
+ }
+ }
+}
\ No newline at end of file
diff --git a/External/Plugins/AS3Context/Context.cs b/External/Plugins/AS3Context/Context.cs
index 4900524bf0..46ea4ca287 100644
--- a/External/Plugins/AS3Context/Context.cs
+++ b/External/Plugins/AS3Context/Context.cs
@@ -1,41 +1,145 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.IO;
-using PluginCore.Managers;
+using System.Text.RegularExpressions;
+using System.Timers;
+using System.Windows.Forms;
+using AS3Context.Compiler;
+using ASCompletion.Completion;
using ASCompletion.Context;
using ASCompletion.Model;
using PluginCore;
-using System.Collections;
-using System.Text.RegularExpressions;
using PluginCore.Controls;
-using PluginCore.Localization;
-using AS3Context.Compiler;
using PluginCore.Helpers;
-using System.Timers;
-using ASCompletion.Completion;
+using PluginCore.Localization;
+using PluginCore.Managers;
+using ScintillaNet;
+using ScintillaNet.Enums;
+using SwfOp;
+using Timer = System.Timers.Timer;
+using AS3Context.Completion;
namespace AS3Context
{
public class Context : AS2Context.Context
{
- static readonly protected Regex re_genericType =
+ protected static readonly Regex re_genericType =
new Regex("(?[^<]+)\\.<(?.+)>$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
// C:\path\to\Main.as$raw$:31: col: 1: Error #1084: Syntax error: expecting rightbrace before end of program.
- static readonly protected Regex re_syntaxError =
+ protected static readonly Regex re_syntaxError =
new Regex("(?.*)\\$raw\\$:(?[0-9]+): col: (? [0-9]+):(?.*)", RegexOptions.Compiled);
- static readonly protected Regex re_customAPI =
+ protected static readonly Regex re_customAPI =
new Regex("[/\\\\](playerglobal|airglobal|builtin)\\.swc", RegexOptions.Compiled | RegexOptions.IgnoreCase);
+ internal static readonly MemberModel StubAsExpression = new MemberModel("as operator", null, FlagType.Declaration, 0)
+ {
+ Comments = "\r\t * Usage " +
+ "\r\t * expression as datatype" +
+ "\r\t * " +
+ "\r\t * Language Version: ActionScript 3.0" +
+ "\r\t * Runtime Versions: Flash Player 9" +
+ "\r\t * " +
+ "\r\t * Evaluates whether an expression specified by the first operand is a member of the data type specified by the second operand." +
+ "\r\t * If the first operand is a member of the data type, the result is the first operand. Otherwise, the result is the value null ." +
+ "\r\t * " +
+ "\r\t * The expression used for the second operand must evaluate to a data type." +
+ "\r\t * " +
+ "\r\t * Operands " +
+ "\r\t * expression :* The value to check against the data type specified." +
+ "\r\t * datatype :Class The data type used to evaluate the expression operand. The special * type, which means untyped, cannot be used." +
+ "\r\t * " +
+ "\r\t * Result " +
+ "\r\t * Object The result is expression if expression is a member of the data type specified in datatype. Otherwise, the result is the value null."
+ };
+
+ internal static readonly MemberModel StubIsExpression = new MemberModel("is operator", null, FlagType.Declaration, 0)
+ {
+ Comments = "\r\t * Usage " +
+ "\r\t * expression is datatype" +
+ "\r\t * " +
+ "\r\t * Language Version: ActionScript 3.0" +
+ "\r\t * Runtime Versions: Flash Player 9" +
+ "\r\t * " +
+ "\r\t * Evaluates whether an object is compatible with a specific data type, class, or interface. Use the is operator instead of the instanceof operator for type comparisons. You can also use the is operator to check whether an object implements an interface." +
+ "\r\t * " +
+ "\r\t * Result " +
+ "\r\t * Boolean A value of true if expression1 is compatible with the data type, class, or interface specified in expression2, and false otherwise."
+ };
+
+ internal static readonly MemberModel StubInstanceOfExpression = new MemberModel("instaceof operator", null, FlagType.Declaration, 0)
+ {
+ Comments = "\r\t * Usage " +
+ "\r\t * expression instanceof function" +
+ "\r\t * " +
+ "\r\t * Language Version: ActionScript 3.0" +
+ "\r\t * Runtime Versions: Flash Player 9" +
+ "\r\t * " +
+ "\r\t * Evaluates whether an expression's prototype chain includes the prototype object for function. The instanceof operator is included for backward compatibility with ECMAScript edition 3, and may be useful for advanced programmers who choose to use prototype-based inheritance with constructor functions instead of classes." +
+ "\r\t * " +
+ "\r\t * To check whether an object is a member of a specific data type, use the is operator." +
+ "\r\t * " +
+ "\r\t * When used with classes, the instanceof operator is similar to the is operator because a class's prototype chain includes all of its superclasses. Interfaces, however, are not included on prototype chains, so the instanceof operator always results in false when used with interfaces, whereas the is operator results in true if an object belongs to a class that implements the specified interface." +
+ "\r\t * " +
+ "\r\t * Note: The ActionScript is operator is the equivalent of the Java instanceof operator." +
+ "\r\t * " +
+ "\r\t * Operands " +
+ "\r\t * expression :Object The object that contains the prototype chain to evaluate." +
+ "\r\t * function :Object A function object (or class)." +
+ "\r\t * " +
+ "\r\t * Result " +
+ "\r\t * Boolean Returns true if the prototype chain of expression includes the prototype object for function , and false otherwise."
+ };
+
+ internal static readonly MemberModel StubTypeOfExpression = new MemberModel("typeof operator", null, FlagType.Declaration, 0)
+ {
+ Comments = "\r\t * Usage " +
+ "\r\t * typeof expression" +
+ "\r\t * " +
+ "\r\t * Language Version: ActionScript 3.0" +
+ "\r\t * Runtime Versions: Flash Player 9" +
+ "\r\t * " +
+ "\r\t * Evaluates expression and returns a string specifying the expression's data type. The result is limited to six possible string values: boolean , function , number , object , string , and xml . If you apply this operator to an instance of a user-defined class, the result is the string object . The typeof operator is included for backward compatibility. Use the is operator to check type compatibility." +
+ "\r\t * " +
+ "\r\t * Operands " +
+ "\r\t * expression :Object An object to evaluate." +
+ "\r\t * " +
+ "\r\t * Result " +
+ "\r\t * String A string representation of the type of expression . The following table shows the results of the typeof operator on each type of expression."
+ };
+
+ internal static readonly MemberModel StubDeleteExpression = new MemberModel("delete operator", null, FlagType.Declaration, 0)
+ {
+ Comments = "\r\t * Usage " +
+ "\r\t * delete reference" +
+ "\r\t * " +
+ "\r\t * Language Version: ActionScript 3.0" +
+ "\r\t * Runtime Versions: Flash Player 9" +
+ "\r\t * " +
+ "\r\t * Destroys the object property specified by reference; the result is true if the property does not exist after the operation completes, and false otherwise. The delete operator returns true if it is called on a nonexistent property or a dynamic property not defined in a class." +
+ "\r\t * " +
+ "\r\t * The delete operator can fail and return false if the reference parameter cannot be deleted. You cannot delete fixed properties or variables that are declared with the var statement. A fixed property is a variable or method defined in a class definition." +
+ "\r\t * " +
+ "\r\t * The delete operator cannot be used to destroy a property of a class, unless that class is a dynamic class added at runtime. Properties of sealed classes cannot be destroyed using delete . Set the property to null instead." +
+ "\r\t * " +
+ "\r\t * Note: You cannot delete an object, but you can make an object eligible for garbage collection by removing all references to the object. The most common reference to an object is a variable that points to it. You can remove such a reference by setting the variable to null . The garbage collector removes any object that has no references." +
+ "\r\t * " +
+ "\r\t * Operands " +
+ "\r\t * reference :* The name of the property to eliminate." +
+ "\r\t * " +
+ "\r\t * Result " +
+ "\r\t * Boolean The value true if the deletion succeeded and false if it failed."
+ };
+
#region initialization
- private AS3Settings as3settings;
- private bool hasAIRSupport;
- private bool hasMobileSupport;
- private MxmlFilterContext mxmlFilterContext; // extract inlined AS3 ranges & MXML tags
- private System.Timers.Timer timerCheck;
- private string fileWithSquiggles;
+
+ readonly AS3Settings as3settings;
+ bool hasAIRSupport;
+ bool hasMobileSupport;
+ MxmlFilterContext mxmlFilterContext; // extract inlined AS3 ranges & MXML tags
+ readonly Timer timerCheck;
+ string fileWithSquiggles;
protected bool mxmlEnabled;
///
@@ -81,7 +185,7 @@ public Context(AS3Settings initSettings)
features.checkFileName = true;
// allowed declarations access modifiers
- Visibility all = Visibility.Public | Visibility.Internal | Visibility.Protected | Visibility.Private;
+ const Visibility all = Visibility.Public | Visibility.Internal | Visibility.Protected | Visibility.Private;
features.classModifiers = all;
features.varModifiers = all;
features.constModifiers = all;
@@ -93,19 +197,21 @@ public Context(AS3Settings initSettings)
features.methodModifierDefault = Visibility.Internal;
// keywords
+ features.ClassKey = "class";
+ features.InterfaceKey = "interface";
+ features.PackageKey = "package";
+ features.ExtendsKey = "extends";
+ features.ImplementsKey = "implements";
features.dot = ".";
features.voidKey = "void";
features.objectKey = "Object";
features.booleanKey = "Boolean";
features.numberKey = "Number";
+ features.IntegerKey = "int";
+ features.stringKey = "String";
features.arrayKey = "Array";
+ features.dynamicKey = "*";
features.importKey = "import";
- features.typesPreKeys = new string[] { "import", "new", "typeof", "is", "as", "extends", "implements" };
- features.codeKeywords = new string[] {
- "class", "interface", "var", "function", "const", "new", "delete", "typeof", "is", "as", "return",
- "break", "continue", "if", "else", "for", "each", "in", "while", "do", "switch", "case", "default", "with",
- "null", "true", "false", "try", "catch", "finally", "throw", "use", "namespace"
- };
features.varKey = "var";
features.constKey = "const";
features.functionKey = "function";
@@ -120,37 +226,56 @@ public Context(AS3Settings initSettings)
features.privateKey = "private";
features.intrinsicKey = "extern";
features.namespaceKey = "namespace";
-
- /* INITIALIZATION */
+ features.ThisKey = "this";
+ features.BaseKey = "super";
+ features.ReturnKey = "return";
+ features.typesPreKeys = new[] { features.importKey, "new", "typeof", "instanceof", "is", "as", features.ExtendsKey, features.ImplementsKey };
+ features.codeKeywords = new[] {
+ "var", "function", "const", "new", "delete", "typeof", "is", "as", features.ReturnKey,
+ "break", "continue", "if", "else", "for", "each", "in", "while", "do", "switch", "case", "default", "with",
+ "null", "true", "false", "try", "catch", "finally", "throw", "use", "namespace", "instanceof",
+ };
+ features.accessKeywords = new[] {"native", "dynamic", "final", "public", "private", "protected", "internal", "static", "override"};
+ features.declKeywords = new[] {features.varKey, features.functionKey, features.constKey, features.namespaceKey, features.getKey, features.setKey};
+ features.typesKeywords = new[] {features.importKey, features.ClassKey, features.InterfaceKey};
+ features.ArithmeticOperators = new HashSet {'+', '-', '*', '/', '%'};
+ features.IncrementDecrementOperators = new[] {"++", "--"};
+ features.BitwiseOperators = new[] {"~", "&", "|", "^", "<<", ">>", ">>>"};
+ features.BooleanOperators = new[] {"<", ">", "&&", "||", "!=", "==", "!==", "===", "!"};
+ features.TernaryOperators = new[] {"?", ":"};
+ features.Literals = new HashSet {"int", "uint"};
+ features.OperatorKeywords = new HashSet
+ {
+ "case",
+ "in",
+ "throw",
+ "typeof",
+ "delete",
+ };
settings = initSettings;
- //BuildClassPath(); // defered to first use
+ CodeComplete = new CodeComplete();
// live syntax checking
- timerCheck = new Timer(500);
- timerCheck.SynchronizingObject = PluginBase.MainForm as System.Windows.Forms.Form;
- timerCheck.AutoReset = false;
- timerCheck.Elapsed += new ElapsedEventHandler(timerCheck_Elapsed);
- FlexShells.SyntaxError += new SyntaxErrorHandler(FlexShell_SyntaxError);
+ timerCheck = new Timer(500) {SynchronizingObject = PluginBase.MainForm as Form, AutoReset = false};
+ timerCheck.Elapsed += timerCheck_Elapsed;
+ FlexShells.SyntaxError += FlexShell_SyntaxError;
}
#endregion
#region classpath management
///
- /// Classpathes & classes cache initialisation
+ /// Classpathes & classes cache initialization
///
public override void BuildClassPath()
{
ReleaseClasspath();
started = true;
- if (as3settings == null) throw new Exception("BuildClassPath() must be overridden");
- if (contextSetup == null)
+ if (as3settings is null) throw new Exception("BuildClassPath() must be overridden");
+ contextSetup ??= new ContextSetupInfos
{
- contextSetup = new ContextSetupInfos();
- contextSetup.Lang = settings.LanguageId;
- contextSetup.Platform = "Flash Player";
- contextSetup.Version = as3settings.DefaultFlashVersion;
- }
+ Lang = settings.LanguageId, Platform = "Flash Player", Version = as3settings.DefaultFlashVersion
+ };
// external version definition
platform = contextSetup.Platform;
@@ -160,8 +285,9 @@ public override void BuildClassPath()
hasAIRSupport = platform == "AIR" || platform == "AIR Mobile";
hasMobileSupport = platform == "AIR Mobile";
- string cpCheck = contextSetup.Classpath != null ?
- String.Join(";", contextSetup.Classpath).Replace('\\', '/') : "";
+ var cpCheck = contextSetup.Classpath != null
+ ? string.Join(";", contextSetup.Classpath).Replace('\\', '/')
+ : "";
// check if CP contains a custom playerglobal.swc
bool hasCustomAPI = re_customAPI.IsMatch(cpCheck);
@@ -179,22 +305,21 @@ public override void BuildClassPath()
: as3settings.GetDefaultSDK().Path;
char S = Path.DirectorySeparatorChar;
- if (compiler == null)
- compiler = Path.Combine(PathHelper.ToolDir, "flexlibs");
+ compiler ??= Path.Combine(PathHelper.ToolDir, "flexlibs");
string frameworks = compiler + S + "frameworks";
string sdkLibs = frameworks + S + "libs";
- string sdkLocales = frameworks + S + "locale" + S + PluginBase.MainForm.Settings.LocaleVersion;
+ string sdkLocales = frameworks + S + "locale" + S + PluginBase.Settings.LocaleVersion;
string fallbackLibs = PathHelper.ResolvePath(PathHelper.ToolDir + S + "flexlibs" + S + "frameworks" + S + "libs");
string fallbackLocale = PathHelper.ResolvePath(PathHelper.ToolDir + S + "flexlibs" + S + "frameworks" + S + "locale" + S + "en_US");
List addLibs = new List();
List addLocales = new List();
- if (!Directory.Exists(sdkLibs) && !sdkLibs.StartsWith("$")) // fallback
+ if (!Directory.Exists(sdkLibs) && !sdkLibs.StartsWith('$')) // fallback
{
sdkLibs = PathHelper.ResolvePath(PathHelper.ToolDir + S + "flexlibs" + S + "frameworks" + S + "libs" + S + "player");
}
- if (majorVersion > 0 && !String.IsNullOrEmpty(sdkLibs) && Directory.Exists(sdkLibs))
+ if (majorVersion > 0 && Directory.Exists(sdkLibs))
{
// core API SWC
if (!hasCustomAPI)
@@ -206,16 +331,16 @@ public override void BuildClassPath()
}
else
{
- bool swcPresent = false;
- string playerglobal = MatchPlayerGlobalExact(majorVersion, minorVersion, sdkLibs);
+ var swcPresent = false;
+ var playerglobal = MatchPlayerGlobalExact(majorVersion, minorVersion, sdkLibs);
if (playerglobal != null) swcPresent = true;
else playerglobal = MatchPlayerGlobalExact(majorVersion, minorVersion, fallbackLibs);
- if (playerglobal == null) playerglobal = MatchPlayerGlobalAny(ref majorVersion, ref minorVersion, fallbackLibs);
- if (playerglobal == null) playerglobal = MatchPlayerGlobalAny(ref majorVersion, ref minorVersion, sdkLibs);
+ playerglobal ??= MatchPlayerGlobalAny(ref majorVersion, ref minorVersion, fallbackLibs)
+ ?? MatchPlayerGlobalAny(ref majorVersion, ref minorVersion, sdkLibs);
if (playerglobal != null)
{
// add missing SWC in new SDKs
- if (!swcPresent && sdkLibs.IndexOf(S + "flexlibs") < 0 && Directory.Exists(compiler))
+ if (!swcPresent && !sdkLibs.Contains(S + "flexlibs") && Directory.Exists(compiler))
{
string swcDir = sdkLibs + S + "player" + S;
if (!Directory.Exists(swcDir + "9") && !Directory.Exists(swcDir + "10"))
@@ -250,16 +375,21 @@ public override void BuildClassPath()
// Flex framework
if (cpCheck.IndexOf("Library/AS3/frameworks/Flex", StringComparison.OrdinalIgnoreCase) >= 0)
{
- addLibs.Add("framework.swc");
- addLibs.Add("mx/mx.swc");
- addLibs.Add("rpc.swc");
- addLibs.Add("datavisualization.swc");
- addLibs.Add("flash-integration.swc");
- addLocales.Add("framework_rb.swc");
- addLocales.Add("mx_rb.swc");
- addLocales.Add("rpc_rb.swc");
- addLocales.Add("datavisualization_rb.swc");
- addLocales.Add("flash-integration_rb.swc");
+ bool isFlexJS = cpCheck.IndexOf("Library/AS3/frameworks/FlexJS", StringComparison.OrdinalIgnoreCase) >= 0;
+
+ if (!isFlexJS)
+ {
+ addLibs.Add("framework.swc");
+ addLibs.Add("mx/mx.swc");
+ addLibs.Add("rpc.swc");
+ addLibs.Add("datavisualization.swc");
+ addLibs.Add("flash-integration.swc");
+ addLocales.Add("framework_rb.swc");
+ addLocales.Add("mx_rb.swc");
+ addLocales.Add("rpc_rb.swc");
+ addLocales.Add("datavisualization_rb.swc");
+ addLocales.Add("flash-integration_rb.swc");
+ }
if (hasAIRSupport)
{
@@ -267,7 +397,14 @@ public override void BuildClassPath()
addLocales.Add("airframework_rb.swc");
}
- if (cpCheck.IndexOf("Library/AS3/frameworks/Flex4", StringComparison.OrdinalIgnoreCase) >= 0)
+ if (isFlexJS)
+ {
+ string flexJsLibs = frameworks + S + "as" + S + "libs";
+ addLibs.Add(flexJsLibs + S + "FlexJSUI.swc");
+ //addLibs.Add(flexJsLibs + S + "FlexJSJX.swc");
+ MxmlFilter.AddManifest("http://ns.adobe.com/mxml/2009", as3Fmk + S + "FlexJS" + S + "manifest.xml");
+ }
+ else if (cpCheck.IndexOf("Library/AS3/frameworks/Flex4", StringComparison.OrdinalIgnoreCase) >= 0)
{
addLibs.Add("spark.swc");
addLibs.Add("spark_dmv.swc");
@@ -312,17 +449,14 @@ public override void BuildClassPath()
}
// intrinsics (deprecated, excepted for FP10 Vector.)
- string fp9cp = as3settings.AS3ClassPath + S + "FP9";
- AddPath(PathHelper.ResolvePath(fp9cp));
- if (majorVersion > 9)
+ // add from the highest version number (FP11 > FP10 > FP9)
+ string fp = as3settings.AS3ClassPath + S + "FP";
+ for (int i = majorVersion; i >= 9; i--)
{
- string fp10cp = as3settings.AS3ClassPath + S + "FP" + majorVersion;
- AddPath(PathHelper.ResolvePath(fp10cp));
- string fp101cp = as3settings.AS3ClassPath + S + "FP" + majorVersion + "." + minorVersion;
- AddPath(PathHelper.ResolvePath(fp101cp));
+ AddPath(PathHelper.ResolvePath(fp + i));
}
- // add external pathes
+ // add external paths
List initCP = classPath;
classPath = new List();
if (contextSetup.Classpath != null)
@@ -333,20 +467,20 @@ public override void BuildClassPath()
// add library
AddPath(PathHelper.LibraryDir + S + "AS3" + S + "classes");
- // add user pathes from settings
- if (settings.UserClasspath != null && settings.UserClasspath.Length > 0)
+ // add user paths from settings
+ if (!settings.UserClasspath.IsNullOrEmpty())
{
foreach (string cpath in settings.UserClasspath) AddPath(cpath.Trim());
}
- // add initial pathes
+ // add initial paths
foreach (PathModel mpath in initCP) AddPath(mpath);
// parse top-level elements
InitTopLevelElements();
if (cFile != null) UpdateTopLevelElements();
- // add current temporaty path
+ // add current temporary path
if (temporaryPath != null)
{
string tempPath = temporaryPath;
@@ -359,11 +493,10 @@ public override void BuildClassPath()
///
/// Find any playerglobal.swc
///
- private string MatchPlayerGlobalAny(ref int majorVersion, ref int minorVersion, string sdkLibs)
+ string MatchPlayerGlobalAny(ref int majorVersion, ref int minorVersion, string sdkLibs)
{
char S = Path.DirectorySeparatorChar;
string libPlayer = sdkLibs + S + "player";
- string playerglobal = null;
for (int i = minorVersion; i >= 0; i--)
{
string version = majorVersion + "." + i;
@@ -373,10 +506,11 @@ private string MatchPlayerGlobalAny(ref int majorVersion, ref int minorVersion,
return libPlayer + S + version + S + "playerglobal.swc";
}
}
- if (playerglobal == null && Directory.Exists(libPlayer + S + majorVersion))
+ string playerglobal = null;
+ if (Directory.Exists(libPlayer + S + majorVersion))
playerglobal = "player" + S + majorVersion + S + "playerglobal.swc";
- if (playerglobal == null && majorVersion > 9)
+ if (playerglobal is null && majorVersion > 9)
{
int tempMajor = majorVersion - 1;
int tempMinor = 9;
@@ -395,7 +529,7 @@ private string MatchPlayerGlobalAny(ref int majorVersion, ref int minorVersion,
///
/// Find version-matching playerglobal.swc
///
- private string MatchPlayerGlobalExact(int majorVersion, int minorVersion, string sdkLibs)
+ string MatchPlayerGlobalExact(int majorVersion, int minorVersion, string sdkLibs)
{
string playerglobal = null;
char S = Path.DirectorySeparatorChar;
@@ -412,25 +546,22 @@ private string MatchPlayerGlobalExact(int majorVersion, int minorVersion, string
///
public override string[] GetExplorerMask()
{
- string[] mask = as3settings.AS3FileTypes;
- if (mask == null || mask.Length == 0 || (mask.Length == 1 && mask[1] == ""))
+ var mask = as3settings.AS3FileTypes;
+ if (mask.IsNullOrEmpty() || (mask.Length == 1 && mask[0] == ""))
{
- as3settings.AS3FileTypes = mask = new string[] { "*.as", "*.mxml" };
+ as3settings.AS3FileTypes = mask = new[] { "*.as", "*.mxml" };
return mask;
}
- else
+ var patterns = new List();
+ foreach (var it in mask)
{
- List patterns = new List();
- for (int i = 0; i < mask.Length; i++)
- {
- string m = mask[i];
- if (string.IsNullOrEmpty(m)) continue;
- if (m[1] != '.' && m[0] != '.') m = '.' + m;
- if (m[0] != '*') m = '*' + m;
- patterns.Add(m);
- }
- return patterns.ToArray();
+ string m = it;
+ if (string.IsNullOrEmpty(m)) continue;
+ if (m[1] != '.' && m[0] != '.') m = '.' + m;
+ if (m[0] != '*') m = '*' + m;
+ patterns.Add(m);
}
+ return patterns.ToArray();
}
///
@@ -456,7 +587,7 @@ public override void ExploreVirtualPath(PathModel path)
lock (path)
{
path.WasExplored = true;
- SwfOp.ContentParser parser = new SwfOp.ContentParser(path.Path);
+ ContentParser parser = new ContentParser(path.Path);
parser.Run();
AbcConverter.Convert(parser, path, this);
}
@@ -483,30 +614,29 @@ public override void ExploreVirtualPath(PathModel path)
public override void RemoveClassCompilerCache()
{
// not implemented - is there any?
- }
-
- ///
- /// Create a new file model without parsing file
- ///
- /// Full path
- /// File model
- public override FileModel CreateFileModel(string fileName)
- {
- if (string.IsNullOrEmpty(fileName) || !File.Exists(fileName))
- return new FileModel(fileName);
-
- fileName = PathHelper.GetLongPathName(fileName);
- if (mxmlEnabled && fileName.EndsWith(".mxml", StringComparison.OrdinalIgnoreCase))
- {
- FileModel nFile = new FileModel(fileName);
- nFile.Context = this;
- nFile.HasFiltering = true;
- return nFile;
- }
- else return base.CreateFileModel(fileName);
}
- private void GuessPackage(string fileName, FileModel nFile)
+ ///
+ /// Create a new file model without parsing file
+ ///
+ /// Full path
+ /// File model
+ public override FileModel CreateFileModel(string fileName)
+ {
+ if (!File.Exists(fileName)) return new FileModel(fileName);
+ fileName = PathHelper.GetLongPathName(fileName);
+ if (mxmlEnabled && fileName.EndsWith(".mxml", StringComparison.OrdinalIgnoreCase))
+ {
+ FileModel nFile = new FileModel(fileName);
+ nFile.Context = this;
+ nFile.HasFiltering = true;
+ return nFile;
+ }
+
+ return base.CreateFileModel(fileName);
+ }
+
+ void GuessPackage(string fileName, FileModel nFile)
{
foreach(PathModel aPath in classPath)
if (fileName.StartsWith(aPath.Path, StringComparison.OrdinalIgnoreCase))
@@ -519,15 +649,6 @@ private void GuessPackage(string fileName, FileModel nFile)
}
}
- ///
- /// Build the file DOM
- ///
- /// File path
- protected override void GetCurrentFileModel(string fileName)
- {
- base.GetCurrentFileModel(fileName);
- }
-
///
/// Refresh the file model
///
@@ -546,16 +667,6 @@ public override void UpdateCurrentFile(bool updateUI)
}
}
- ///
- /// Update the class/member context for the given line number.
- /// Be carefull to restore the context after calling it with a custom line number
- ///
- ///
- public override void UpdateContext(int line)
- {
- base.UpdateContext(line);
- }
-
///
/// Called if a FileModel needs filtering
/// - define inline AS3 ranges
@@ -586,11 +697,12 @@ public override void FilterSource(FileModel model)
internal void OnFileOperation(NotifyEvent e)
{
timerCheck.Stop();
- foreach (ITabbedDocument doc in PluginBase.MainForm.Documents)
- if (doc.FileName == fileWithSquiggles) ClearSquiggles(doc.SciControl);
+ foreach (var doc in PluginBase.MainForm.Documents)
+ if (doc.SciControl is { } sci && sci.FileName == fileWithSquiggles)
+ ClearSquiggles(sci);
}
- public override void TrackTextChange(ScintillaNet.ScintillaControl sender, int position, int length, int linesAdded)
+ public override void TrackTextChange(ScintillaControl sender, int position, int length, int linesAdded)
{
base.TrackTextChange(sender, position, length, linesAdded);
if (as3settings != null && !as3settings.DisableLiveChecking && IsFileValid)
@@ -600,39 +712,39 @@ public override void TrackTextChange(ScintillaNet.ScintillaControl sender, int p
}
}
- private void timerCheck_Elapsed(object sender, ElapsedEventArgs e)
- {
- BackgroundSyntaxCheck();
- }
+ void timerCheck_Elapsed(object sender, ElapsedEventArgs e) => BackgroundSyntaxCheck();
///
/// Checking syntax of current file
///
- private void BackgroundSyntaxCheck()
+ void BackgroundSyntaxCheck()
{
if (!IsFileValid) return;
- ScintillaNet.ScintillaControl sci = CurSciControl;
- if (sci == null) return;
+ var sci = PluginBase.MainForm.CurrentDocument?.SciControl;
+ if (sci is null) return;
ClearSquiggles(sci);
- string src = CurSciControl.Text;
- string sdk = PluginBase.CurrentProject != null && PluginBase.CurrentProject.Language == "as3"
+ var sdk = PluginBase.CurrentProject != null && PluginBase.CurrentProject.Language == "as3"
? PluginBase.CurrentProject.CurrentSDK
: as3settings.GetDefaultSDK().Path;
- FlexShells.Instance.CheckAS3(CurrentFile, sdk, src);
+ FlexShells.Instance.CheckAS3(CurrentFile, sdk, sci.Text);
+ }
+
+ void AddSquiggles(ScintillaControl sci, int line, int start, int end)
+ {
+ if (sci is null) return;
+ fileWithSquiggles = CurrentFile;
+ int position = sci.PositionFromLine(line) + start;
+ sci.AddHighlight(2, (int)IndicatorStyle.Squiggle, 0x000000ff, position, end - start);
}
- private void ClearSquiggles(ScintillaNet.ScintillaControl sci)
+ void ClearSquiggles(ScintillaControl sci)
{
- if (sci == null) return;
+ if (sci is null) return;
try
{
- int es = sci.EndStyled;
- int mask = (1 << sci.StyleBits);
- sci.StartStyling(0, mask);
- sci.SetStyling(sci.TextLength, 0);
- sci.StartStyling(es, mask - 1);
+ sci.RemoveHighlights(2);
}
finally
{
@@ -640,26 +752,25 @@ private void ClearSquiggles(ScintillaNet.ScintillaControl sci)
}
}
- private void FlexShell_SyntaxError(string error)
+ void FlexShell_SyntaxError(string error)
{
if (!IsFileValid) return;
- Match m = re_syntaxError.Match(error);
+ var document = PluginBase.MainForm.CurrentDocument;
+ if (document is null || !document.IsEditable) return;
+ var m = re_syntaxError.Match(error);
if (!m.Success) return;
- ITabbedDocument document = PluginBase.MainForm.CurrentDocument;
- if (document == null || !document.IsEditable) return;
-
- ScintillaNet.ScintillaControl sci = document.SplitSci1;
- ScintillaNet.ScintillaControl sci2 = document.SplitSci2;
+ var sci1 = document.SplitSci1;
+ var sci2 = document.SplitSci2;
if (m.Groups["filename"].Value != CurrentFile) return;
try
{
int line = int.Parse(m.Groups["line"].Value) - 1;
- if (sci.LineCount < line) return;
- int start = MBSafeColumn(sci, line, int.Parse(m.Groups["col"].Value) - 1);
- if (line == sci.LineCount && start == 0 && line > 0) start = -1;
- AddSquiggles(sci, line, start, start + 1);
+ if (sci1.LineCount < line) return;
+ int start = MBSafeColumn(sci1, line, int.Parse(m.Groups["col"].Value) - 1);
+ if (line == sci1.LineCount && start == 0 && line > 0) start = -1;
+ AddSquiggles(sci1, line, start, start + 1);
AddSquiggles(sci2, line, start, start + 1);
}
catch { }
@@ -668,26 +779,13 @@ private void FlexShell_SyntaxError(string error)
///
/// Convert multibyte column to byte length
///
- private int MBSafeColumn(ScintillaNet.ScintillaControl sci, int line, int length)
+ static int MBSafeColumn(ScintillaControl sci, int line, int length)
{
- String text = sci.GetLine(line) ?? "";
+ var text = sci.GetLine(line) ?? "";
length = Math.Min(length, text.Length);
return sci.MBSafeTextLength(text.Substring(0, length));
}
- private void AddSquiggles(ScintillaNet.ScintillaControl sci, int line, int start, int end)
- {
- if (sci == null) return;
- fileWithSquiggles = CurrentFile;
- int position = sci.PositionFromLine(line) + start;
- int es = sci.EndStyled;
- int mask = 1 << sci.StyleBits;
- sci.SetIndicStyle(0, (int)ScintillaNet.Enums.IndicatorStyle.Squiggle);
- sci.SetIndicFore(0, 0x000000ff);
- sci.StartStyling(position, mask);
- sci.SetStyling(end - start, mask);
- sci.StartStyling(es, mask - 1);
- }
#endregion
#region class resolution
@@ -700,27 +798,27 @@ private void AddSquiggles(ScintillaNet.ScintillaControl sci, int line, int start
/// Completion visibility
public override Visibility TypesAffinity(ClassModel inClass, ClassModel withClass)
{
- if (inClass == null || withClass == null) return Visibility.Public;
+ if (inClass is null || withClass is null) return Visibility.Public;
// same file
if (inClass.InFile == withClass.InFile)
return Visibility.Public | Visibility.Internal | Visibility.Protected | Visibility.Private;
// same package
- Visibility acc = Visibility.Public;
- if (inClass.InFile.Package == withClass.InFile.Package) acc |= Visibility.Internal;
+ var result = Visibility.Public;
+ if (inClass.InFile.Package == withClass.InFile.Package) result |= Visibility.Internal;
// inheritance affinity
- ClassModel tmp = inClass;
+ var tmp = inClass;
while (!tmp.IsVoid())
{
if (tmp.Type == withClass.Type)
{
- acc |= Visibility.Protected;
+ result |= Visibility.Protected;
break;
}
tmp = tmp.Extends;
}
- return acc;
+ return result;
}
///
@@ -733,49 +831,49 @@ public override MemberList GetAllProjectClasses()
if (!completionCache.IsDirty && completionCache.AllTypes != null)
return completionCache.AllTypes;
- MemberList fullList = new MemberList();
+ var fullList = new MemberList();
ClassModel aClass;
MemberModel item;
// public & internal classes
- string package = CurrentModel.Package;
- foreach (PathModel aPath in classPath) if (aPath.IsValid && !aPath.Updating)
- {
- aPath.ForeachFile((aFile) =>
+ string package = CurrentModel?.Package;
+ foreach (var aPath in classPath)
+ if (aPath.IsValid && !aPath.Updating)
{
- if (!aFile.HasPackage)
- return true; // skip
-
- aClass = aFile.GetPublicClass();
- if (!aClass.IsVoid() && aClass.IndexType == null)
+ aPath.ForeachFile((aFile) =>
{
- if (aClass.Access == Visibility.Public
- || (aClass.Access == Visibility.Internal && aFile.Package == package))
+ if (!aFile.HasPackage)
+ return true; // skip
+
+ aClass = aFile.GetPublicClass();
+ if (!aClass.IsVoid() && aClass.IndexType is null)
{
- item = aClass.ToMemberModel();
- item.Name = item.Type;
- fullList.Add(item);
+ if (aClass.Access == Visibility.Public
+ || (aClass.Access == Visibility.Internal && aFile.Package == package))
+ {
+ item = aClass.ToMemberModel();
+ item.Name = item.Type;
+ fullList.Add(item);
+ }
}
- }
- if (aFile.Package.Length > 0 && aFile.Members.Count > 0)
- {
- foreach (MemberModel member in aFile.Members)
+ if (aFile.Package.Length > 0 && aFile.Members.Count > 0)
{
- item = member.Clone() as MemberModel;
- item.Name = aFile.Package + "." + item.Name;
- fullList.Add(item);
+ foreach (var member in aFile.Members)
+ {
+ item = member.Clone();
+ item.Name = aFile.Package + "." + item.Name;
+ fullList.Add(item);
+ }
}
- }
- else if (aFile.Members.Count > 0)
- {
- foreach (MemberModel member in aFile.Members)
+ else if (aFile.Members.Count > 0)
{
- item = member.Clone() as MemberModel;
- fullList.Add(item);
+ foreach (var member in aFile.Members)
+ {
+ fullList.Add(member.Clone());
+ }
}
- }
- return true;
- });
- }
+ return true;
+ });
+ }
// void
fullList.Add(new MemberModel(features.voidKey, features.voidKey, FlagType.Class | FlagType.Intrinsic, 0));
// private classes
@@ -787,59 +885,43 @@ public override MemberList GetAllProjectClasses()
return fullList;
}
- public override bool OnCompletionInsert(ScintillaNet.ScintillaControl sci, int position, string text, char trigger)
+ public override bool OnCompletionInsert(ScintillaControl sci, int position, string text, char trigger)
{
- if (text == "Vector")
+ if (text != "Vector") return text.StartsWithOrdinal("Vector.<");
+ string insert = null;
+ var line = sci.GetLine(sci.LineFromPosition(position));
+ var m = Regex.Match(line, @"\s*=\s*new");
+ if (m.Success)
{
- string insert = null;
- string line = sci.GetLine(sci.LineFromPosition(position));
- Match m = Regex.Match(line, @"\svar\s+(?.+)\s*:\s*Vector\.<(?.+)(?=(>\s*=))");
- if (m.Success)
- {
- insert = String.Format(".<{0}>", m.Groups["indextype"].Value);
- }
- else
- {
- m = Regex.Match(line, @"\s*=\s*new");
- if (m.Success)
- {
- ASResult result = ASComplete.GetExpressionType(sci, sci.PositionFromLine(sci.LineFromPosition(position)) + m.Index);
- if (result != null && !result.IsNull() && result.Member != null && result.Member.Type != null)
- {
- m = Regex.Match(result.Member.Type, @"(?<=<).+(?=>)");
- if (m.Success)
- {
- insert = String.Format(".<{0}>", m.Value);
- }
- }
- }
- if (insert == null)
- {
- if (trigger == '.' || trigger == '(') return true;
- insert = ".<>";
- sci.InsertText(position + text.Length, insert);
- sci.CurrentPos = position + text.Length + 2;
- sci.SetSel(sci.CurrentPos, sci.CurrentPos);
- ASComplete.HandleAllClassesCompletion(sci, "", false, true);
- return true;
- }
- }
- if (insert == null) return false;
- if (trigger == '.')
+ var result = ASComplete.GetExpressionType(sci, sci.PositionFromLine(sci.LineFromPosition(position)) + m.Index);
+ if (result != null && !result.IsNull() && result.Member?.Type != null)
{
- sci.InsertText(position + text.Length, insert.Substring(1));
- sci.CurrentPos = position + text.Length;
- }
- else
- {
- sci.InsertText(position + text.Length, insert);
- sci.CurrentPos = position + text.Length + insert.Length;
+ m = Regex.Match(result.Member.Type, @"(?<=<).+(?=>)");
+ if (m.Success) insert = $".<{m.Value}>";
}
+ }
+ if (insert is null)
+ {
+ if (trigger == '.' || trigger == '(') return true;
+ insert = ".<>";
+ sci.InsertText(position + text.Length, insert);
+ sci.CurrentPos = position + text.Length + 2;
sci.SetSel(sci.CurrentPos, sci.CurrentPos);
+ ASComplete.HandleAllClassesCompletion(sci, "", false, true);
return true;
}
-
- return false;
+ if (trigger == '.')
+ {
+ sci.InsertText(position + text.Length, insert.Substring(1));
+ sci.CurrentPos = position + text.Length;
+ }
+ else
+ {
+ sci.InsertText(position + text.Length, insert);
+ sci.CurrentPos = position + text.Length + insert.Length;
+ }
+ sci.SetSel(sci.CurrentPos, sci.CurrentPos);
+ return true;
}
///
@@ -851,74 +933,142 @@ public override bool OnCompletionInsert(ScintillaNet.ScintillaControl sci, int p
/// Position in the file
public override bool IsImported(MemberModel member, int atLine)
{
- FileModel cFile = ASContext.Context.CurrentModel;
- // same package is auto-imported
- string package = member.Type.Length > member.Name.Length
+ if (member == ClassModel.VoidClass) return false;
+ var package = member.InFile?.Package;
+ if (string.IsNullOrEmpty(package)) package = null;
+ package ??= member.Type.Length > member.Name.Length
? member.Type.Substring(0, member.Type.Length - member.Name.Length - 1)
- : "";
- if (package == cFile.Package) return true;
- return base.IsImported(member, atLine);
+ : string.Empty;
+ if (package == "globalClassifier") return true;
+ // same package is auto-imported
+ return package == Context.CurrentModel.Package || base.IsImported(member, atLine);
}
///
/// Retrieves a class model from its name
///
/// Class (short or full) name
- /// Current file
+ /// Current file
/// A parsed class or an empty ClassModel if the class is not found
public override ClassModel ResolveType(string cname, FileModel inFile)
{
// handle generic types
- if (cname != null && cname.IndexOf('<') > 0)
+ if (!string.IsNullOrEmpty(cname))
{
- Match genType = re_genericType.Match(cname);
- if (genType.Success)
- return ResolveGenericType(genType.Groups["gen"].Value, genType.Groups["type"].Value, inFile);
- else return ClassModel.VoidClass;
+ var index = cname.IndexOf('<');
+ if (index != -1)
+ {
+ if (index == 0)
+ {
+ // transform [] to Vector.
+ cname = Regex.Replace(cname, @">\[.*", ">");
+ cname = "Vector." + cname;
+ }
+ // transform Vector to Vector.
+ if (cname.Contains("Vector<")) cname = cname.Replace("Vector<", "Vector.<");
+ var genType = re_genericType.Match(cname);
+ return genType.Success
+ ? ResolveGenericType(genType.Groups["gen"].Value, genType.Groups["type"].Value, inFile)
+ : ClassModel.VoidClass;
+ }
}
return base.ResolveType(cname, inFile);
}
+ static readonly Regex re_asExpr = new Regex(@"\((?.+)\s(?as)\s+(?\w+)\)");
+ static readonly Regex re_isExpr = new Regex(@"\((?.+)\s(?is)\s+(?\w+)\)");
+
+ public override ClassModel ResolveToken(string token, FileModel inFile)
+ {
+ var tokenLength = token?.Length ?? 0;
+ if (tokenLength > 0)
+ {
+ if (token.StartsWithOrdinal("0x")) return ResolveType("uint", inFile);
+ var first = token[0];
+ if (first == '<' && tokenLength >= 3 && token[tokenLength - 2] == '/' && token[tokenLength - 1] == '>') return ResolveType("XML", inFile);
+ if (first == '(' && token[token.Length - 1] == ')')
+ {
+ if (re_isExpr.IsMatch(token)) return ResolveType(features.booleanKey, inFile);
+ var m = re_asExpr.Match(token);
+ if (m.Success) return ResolveType(m.Groups["rv"].Value.Trim(), inFile);
+ }
+ if (char.IsLetter(first))
+ {
+ var index = token.IndexOf(' ');
+ if (index != -1)
+ {
+ var word = token.Substring(0, index);
+ if (word == "new")
+ {
+ var dot = ' ';
+ var parCount = 0;
+ for (var i = 0; i < tokenLength; i++)
+ {
+ var c = token[i];
+ if (c == '(') parCount++;
+ else if (c == ')')
+ {
+ parCount--;
+ if (parCount == 0) dot = '.';
+ }
+ else if (dot != ' ' && c == dot) return ClassModel.VoidClass;
+ }
+ token = token.Substring(index + 1);
+ if (token[token.Length - 1] == ')') token = Regex.Replace(token, @"\(.*", string.Empty);
+ return ResolveType(token, inFile);
+ }
+ }
+ }
+ }
+ return base.ResolveToken(token, inFile);
+ }
+
///
/// Retrieve/build typed copies of generic types
///
- private ClassModel ResolveGenericType(string baseType, string indexType, FileModel inFile)
+ ClassModel ResolveGenericType(string baseType, string indexType, FileModel inFile)
{
- ClassModel originalClass = base.ResolveType(baseType, inFile);
+ var originalClass = base.ResolveType(baseType, inFile);
if (originalClass.IsVoid()) return originalClass;
+ if (indexType == "*")
+ {
+ originalClass.IndexType = "*";
+ return originalClass;
+ }
- ClassModel indexClass = ResolveType(indexType, inFile);
+ var indexClass = ResolveType(indexType, inFile);
if (indexClass.IsVoid()) return originalClass;
indexType = indexClass.QualifiedName;
FileModel aFile = originalClass.InFile;
// is the type already cloned?
- foreach (ClassModel otherClass in aFile.Classes)
+ foreach (var otherClass in aFile.Classes)
if (otherClass.IndexType == indexType) return otherClass;
// clone the type
- ClassModel aClass = originalClass.Clone() as ClassModel;
-
+ var aClass = originalClass.Clone();
aClass.Name = baseType + ".<" + indexType + ">";
aClass.IndexType = indexType;
string typed = "<" + indexType + ">";
- foreach (MemberModel member in aClass.Members)
+ foreach (var member in aClass.Members)
{
if (member.Name == baseType) member.Name = baseType.Replace("", typed);
- if (member.Type != null && member.Type.IndexOf('T') >= 0)
+ if (member.Type != null && member.Type.Contains('T'))
{
- if (member.Type == "T") member.Type = indexType;
- else member.Type = member.Type.Replace("", typed);
+ member.Type = member.Type == "T"
+ ? indexType
+ : member.Type.Replace("", typed);
}
if (member.Parameters != null)
{
- foreach (MemberModel param in member.Parameters)
+ foreach (var param in member.Parameters)
{
- if (param.Type != null && param.Type.IndexOf('T') >= 0)
+ if (param.Type != null && param.Type.Contains('T'))
{
- if (param.Type == "T") param.Type = indexType;
- else param.Type = param.Type.Replace("", typed);
+ param.Type = param.Type == "T"
+ ? indexType
+ : param.Type.Replace("", typed);
}
}
}
@@ -930,19 +1080,20 @@ private ClassModel ResolveGenericType(string baseType, string indexType, FileMod
protected MemberList GetPrivateClasses()
{
- MemberList list = new MemberList();
+ var list = new MemberList();
// private classes
- foreach(ClassModel model in cFile.Classes)
- if (model.Access == Visibility.Private)
- {
- MemberModel item = model.ToMemberModel();
- item.Type = item.Name;
- item.Access = Visibility.Private;
- list.Add(item);
- }
+ if (cFile != null)
+ foreach (var model in cFile.Classes)
+ if (model.Access == Visibility.Private)
+ {
+ var item = model.ToMemberModel();
+ item.Type = item.Name;
+ item.Access = Visibility.Private;
+ list.Add(item);
+ }
// 'Class' members
if (cClass != null)
- foreach (MemberModel member in cClass.Members)
+ foreach (var member in cClass.Members)
if (member.Type == "Class") list.Add(member);
return list;
}
@@ -952,18 +1103,60 @@ protected MemberList GetPrivateClasses()
///
protected override void InitTopLevelElements()
{
- string filename = "toplevel.as";
+ const string filename = "toplevel.as";
topLevel = new FileModel(filename);
-
- if (topLevel.Members.Search("this", 0, 0) == null)
- topLevel.Members.Add(new MemberModel("this", "", FlagType.Variable | FlagType.Intrinsic, Visibility.Public));
- if (topLevel.Members.Search("super", 0, 0) == null)
- topLevel.Members.Add(new MemberModel("super", "", FlagType.Variable | FlagType.Intrinsic, Visibility.Public));
- if (topLevel.Members.Search(features.voidKey, 0, 0) == null)
- topLevel.Members.Add(new MemberModel(features.voidKey, "", FlagType.Intrinsic, Visibility.Public));
+ if (!topLevel.Members.Contains(features.ThisKey)) topLevel.Members.Add(new MemberModel(features.ThisKey, string.Empty, FlagType.Variable | FlagType.Intrinsic, Visibility.Public));
+ if (!topLevel.Members.Contains(features.BaseKey)) topLevel.Members.Add(new MemberModel(features.BaseKey, string.Empty, FlagType.Variable | FlagType.Intrinsic, Visibility.Public));
+ if (!topLevel.Members.Contains(features.voidKey)) topLevel.Members.Add(new MemberModel(features.voidKey, string.Empty, FlagType.Intrinsic, Visibility.Public));
topLevel.Members.Sort();
}
+ public override string GetDefaultValue(string type)
+ {
+ if (string.IsNullOrEmpty(type) || type == features.voidKey) return null;
+ if (type == features.dynamicKey) return "undefined";
+ return type switch
+ {
+ "int" => "0",
+ "uint" => "0",
+ "Number" => "NaN",
+ "Boolean" => "false",
+ _ => "null",
+ };
+ }
+
+ public override IEnumerable DecomposeTypes(IEnumerable types)
+ {
+ var characterClass = ScintillaControl.Configuration.GetLanguage("as3").characterclass.Characters;
+ var result = new HashSet();
+ foreach (var type in types)
+ {
+ if (string.IsNullOrEmpty(type)) result.Add("*");
+ else if (type.Contains("<"))
+ {
+ var length = type.Length;
+ var pos = 0;
+ for (var i = 0; i < length; i++)
+ {
+ var c = type[i];
+ if (c == '.' || characterClass.Contains(c)) continue;
+ if (c == '<')
+ {
+ result.Add(type.Substring(pos, i - pos - 1));
+ pos = i + 1;
+ }
+ else if (c == '>')
+ {
+ result.Add(type.Substring(pos, i - pos));
+ break;
+ }
+ }
+ }
+ else result.Add(type);
+ }
+ return result;
+ }
+
#endregion
#region Command line compiler
@@ -971,25 +1164,19 @@ protected override void InitTopLevelElements()
///
/// Retrieve the context's default compiler path
///
- public override string GetCompilerPath()
- {
- return as3settings.GetDefaultSDK().Path ?? "Tools\\flexsdk";
- }
+ public override string GetCompilerPath() => as3settings.GetDefaultSDK().Path ?? "Tools\\flexsdk";
///
/// Check current file's syntax
///
public override void CheckSyntax()
{
- if (IsFileValid && cFile.InlinedIn == null)
- {
- PluginBase.MainForm.CallCommand("Save", null);
-
- string sdk = PluginBase.CurrentProject != null
- ? PluginBase.CurrentProject.CurrentSDK
- : PathHelper.ResolvePath(as3settings.GetDefaultSDK().Path);
- FlexShells.Instance.CheckAS3(cFile.FileName, sdk);
- }
+ if (!IsFileValid || cFile.InlinedIn != null) return;
+ PluginBase.MainForm.CallCommand("Save", null);
+ var sdk = PluginBase.CurrentProject != null
+ ? PluginBase.CurrentProject.CurrentSDK
+ : PathHelper.ResolvePath(as3settings.GetDefaultSDK().Path);
+ FlexShells.Instance.CheckAS3(cFile.FileName, sdk);
}
///
@@ -1003,15 +1190,11 @@ public override void RunCMD(string append)
MessageBar.ShowWarning(TextHelper.GetString("Info.InvalidClass"));
return;
}
-
- string command = (append ?? "") + " -- " + CurrentFile;
+ var command = (append ?? "") + " -- " + CurrentFile;
FlexShells.Instance.RunMxmlc(command, as3settings.GetDefaultSDK().Path);
}
- private bool IsCompilationTarget()
- {
- return (!MainForm.CurrentDocument.IsUntitled && CurrentModel.Version >= 3);
- }
+ bool IsCompilationTarget() => (!PluginBase.MainForm.CurrentDocument.IsUntitled && CurrentModel.Version >= 3);
///
/// Calls RunCMD with additional parameters taken from the classes @mxmlc doc tag
@@ -1023,15 +1206,108 @@ public override bool BuildCMD(bool failSilently)
MessageBar.ShowWarning(TextHelper.GetString("Info.InvalidClass"));
return false;
}
-
- MainForm.CallCommand("SaveAllModified", null);
-
- string sdk = PluginBase.CurrentProject != null
+ PluginBase.MainForm.CallCommand("SaveAllModified", null);
+ var sdk = PluginBase.CurrentProject != null
? PluginBase.CurrentProject.CurrentSDK
: as3settings.GetDefaultSDK().Path;
FlexShells.Instance.QuickBuild(CurrentModel, sdk, failSilently, as3settings.PlayAfterBuild);
return true;
}
#endregion
+
+ #region Custom behavior of Scintilla
+
+ ///
+ public override void OnBraceMatch(ScintillaControl sci)
+ {
+ if (!sci.IsBraceMatching || sci.SelTextSize != 0) return;
+ var position = sci.CurrentPos - 1;
+ var character = (char) sci.CharAt(position);
+ if (character != '<' && character != '>')
+ {
+ position = sci.CurrentPos;
+ character = (char) sci.CharAt(position);
+ }
+ if (character == '<' || character == '>')
+ {
+ if (!sci.PositionIsOnComment(position))
+ {
+ var bracePosStart = position;
+ var bracePosEnd = BraceMatch(sci, position);
+ if (bracePosEnd != -1) sci.BraceHighlight(bracePosStart, bracePosEnd);
+ if (sci.UseHighlightGuides)
+ {
+ var line = sci.LineFromPosition(position);
+ sci.HighlightGuide = sci.GetLineIndentation(line);
+ }
+ }
+ else
+ {
+ sci.BraceHighlight(-1, -1);
+ sci.HighlightGuide = 0;
+ }
+ }
+ }
+
+ ///
+ /// Find the position of a matching '<' and '>' or INVALID_POSITION if no match.
+ ///
+ protected internal int BraceMatch(ScintillaControl sci, int position)
+ {
+ if (sci.PositionIsOnComment(position) || sci.PositionIsInString(position)) return -1;
+ var language = ScintillaControl.Configuration.GetLanguage(sci.ConfigurationLanguage);
+ if (language is null) return -1;
+ var characters = language.characterclass.Characters;
+ var sub = 0;
+ switch (sci.CharAt(position))
+ {
+ case '<':
+ var length = sci.TextLength;
+ while (position < length)
+ {
+ position++;
+ if (sci.PositionIsOnComment(position)) continue;
+ var c = sci.CharAt(position);
+ if (c == ' ') continue;
+ if (c == '<') sub++;
+ else if (c == '>')
+ {
+ sub--;
+ if (sub < 0) return position;
+ }
+ else if (c != '.'
+ // Vector>
+ && !characters.Contains((char) c))
+ {
+ return -1;
+ }
+ }
+ break;
+ case '>':
+ while (position >= 0)
+ {
+ position--;
+ if (sci.PositionIsOnComment(position)) continue;
+ var c = sci.CharAt(position);
+ if (c == ' ') continue;
+ if (c == '>') sub++;
+ else if (c == '<')
+ {
+ sub--;
+ if (sub < 0) return position;
+ }
+ else if (c != '.'
+ // Vector>
+ && !characters.Contains((char) c))
+ {
+ return -1;
+ }
+ }
+ break;
+ }
+ return -1;
+ }
+
+ #endregion
}
-}
+}
\ No newline at end of file
diff --git a/External/Plugins/AS3Context/Controls/ObjectRefsGrid.cs b/External/Plugins/AS3Context/Controls/ObjectRefsGrid.cs
index aeec8fad67..d834aa5127 100644
--- a/External/Plugins/AS3Context/Controls/ObjectRefsGrid.cs
+++ b/External/Plugins/AS3Context/Controls/ObjectRefsGrid.cs
@@ -1,22 +1,20 @@
-using System;
-using System.Collections.Generic;
-using System.Text;
-using Aga.Controls.Tree;
+using Aga.Controls.Tree;
using Aga.Controls.Tree.NodeControls;
using PluginCore;
using PluginCore.Helpers;
+using System.Drawing;
namespace AS3Context.Controls
{
public class ObjectRefsGrid:TreeViewAdv
{
- NodeTextBox methodTB;
- NodeTextBox fileTB;
- NodeTextBox lineTB;
+ readonly NodeTextBox methodTB;
+ readonly NodeTextBox fileTB;
+ readonly NodeTextBox lineTB;
public ObjectRefsGrid()
{
- BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ BorderStyle = System.Windows.Forms.BorderStyle.None;
Dock = System.Windows.Forms.DockStyle.Fill;
GridLineStyle = GridLineStyle.HorizontalAndVertical;
Font = PluginBase.Settings.DefaultFont;
@@ -46,15 +44,25 @@ public ObjectRefsGrid()
NodeControls.Add(methodTB);
NodeControls.Add(fileTB);
NodeControls.Add(lineTB);
+
+ this.CustomDrawHeaders = PluginBase.MainForm.GetThemeColor("ColumnHeader.BorderColor") != Color.Empty;
+ this.ColumnHeaderBackColor = PluginBase.MainForm.GetThemeColor("ColumnHeader.BackColor", SystemColors.Control);
+ this.ColumnHeaderTextColor = PluginBase.MainForm.GetThemeColor("ColumnHeader.TextColor", SystemColors.ControlText);
+ this.ColumnHeaderBorderColor = PluginBase.MainForm.GetThemeColor("ColumnHeader.BorderColor", SystemColors.ActiveBorder);
+ this.LineColor = PluginBase.MainForm.GetThemeColor("DataTreeControl.LineColor", SystemColors.ActiveBorder);
+ this.LineColor2 = PluginBase.MainForm.GetThemeColor("DataTreeControl.LineColor", SystemColors.ActiveBorder);
+ this.DragDropMarkColor = PluginBase.MainForm.GetThemeColor("DataTreeControl.ForeColor", SystemColors.WindowText);
+ this.ForeColor = PluginBase.MainForm.GetThemeColor("TreeViewAdv.ForeColor", SystemColors.ControlText);
+ this.BackColor = PluginBase.MainForm.GetThemeColor("TreeViewAdv.BackColor", SystemColors.Control);
}
}
public class ObjectRefsNode : Node
{
- string method;
- string path;
- string file;
- string line;
+ readonly string method;
+ readonly string path;
+ readonly string file;
+ readonly string line;
public ObjectRefsNode(string method, string file, string line)
{
@@ -66,22 +74,13 @@ public ObjectRefsNode(string method, string file, string line)
this.line = line;
}
- public String Method
- {
- get { return method; }
- }
- public String Path
- {
- get { return path; }
- }
- public String File
- {
- get { return file; }
- }
- public String Line
- {
- get { return line; }
- }
+ public string Method => method;
+
+ public string Path => path;
+
+ public string File => file;
+
+ public string Line => line;
}
public class ObjectRefsModel : TreeModel
diff --git a/External/Plugins/AS3Context/Controls/ProfilerLiveObjectsView.cs b/External/Plugins/AS3Context/Controls/ProfilerLiveObjectsView.cs
index 86aeaddcf4..2229fbcfff 100644
--- a/External/Plugins/AS3Context/Controls/ProfilerLiveObjectsView.cs
+++ b/External/Plugins/AS3Context/Controls/ProfilerLiveObjectsView.cs
@@ -1,9 +1,9 @@
using System;
+using System.Collections;
using System.Collections.Generic;
-using System.Text;
using System.Windows.Forms;
-using System.Collections;
using PluginCore;
+using PluginCore.Localization;
namespace AS3Context.Controls
{
@@ -13,67 +13,62 @@ class ProfilerLiveObjectsView
{
public event ViewObjectEvent OnViewObject;
- ListViewXP listView;
- private Dictionary items;
- private Dictionary finished = new Dictionary();
- private TypeItemComparer comparer;
- private ToolStripMenuItem viewObjectsItem;
+ Dictionary items;
+ readonly TypeItemComparer comparer;
+ readonly ToolStripMenuItem viewObjectsItem;
- public ProfilerLiveObjectsView(ListViewXP view)
+ public ListView ListView { get; }
+
+ public ProfilerLiveObjectsView(ListView view)
{
// config
- listView = view;
+ ListView = view;
comparer = new TypeItemComparer();
comparer.SortColumn = TypeItem.COL_COUNT;
comparer.Sorting = SortOrder.Descending;
- listView.ListViewItemSorter = comparer;
- listView.ColumnClick += new ColumnClickEventHandler(listView_ColumnClick);
+ ListView.ListViewItemSorter = comparer;
+ ListView.ColumnClick += ListView_ColumnClick;
// action
- viewObjectsItem = new ToolStripMenuItem(PluginCore.Localization.TextHelper.GetString("Label.ViewObjectsItem"));
- viewObjectsItem.Click += new EventHandler(onViewObjects);
+ viewObjectsItem = new ToolStripMenuItem(TextHelper.GetString("Label.ViewObjectsItem"));
+ viewObjectsItem.Click += OnViewObjects;
- listView.ContextMenuStrip = new ContextMenuStrip();
- listView.ContextMenuStrip.Font = PluginBase.Settings.DefaultFont;
- listView.ContextMenuStrip.Renderer = new DockPanelStripRenderer(false);
- listView.ContextMenuStrip.Items.Add(viewObjectsItem);
+ ListView.ContextMenuStrip = new ContextMenuStrip();
+ ListView.ContextMenuStrip.Font = PluginBase.Settings.DefaultFont;
+ ListView.ContextMenuStrip.Renderer = new DockPanelStripRenderer(false);
+ ListView.ContextMenuStrip.Items.Add(viewObjectsItem);
- listView.DoubleClick += new EventHandler(onViewObjects);
+ ListView.DoubleClick += OnViewObjects;
}
- void listView_ColumnClick(object sender, ColumnClickEventArgs e)
+ void ListView_ColumnClick(object sender, ColumnClickEventArgs e)
{
if (comparer.SortColumn == e.Column)
{
- if (comparer.Sorting == SortOrder.Ascending)
- comparer.Sorting = SortOrder.Descending;
- else comparer.Sorting = SortOrder.Ascending;
+ comparer.Sorting = comparer.Sorting == SortOrder.Ascending ? SortOrder.Descending : SortOrder.Ascending;
}
else
{
comparer.SortColumn = e.Column;
- if (e.Column >= 2)
- comparer.Sorting = SortOrder.Descending;
- else comparer.Sorting = SortOrder.Ascending;
+ comparer.Sorting = e.Column >= 2 ? SortOrder.Descending : SortOrder.Ascending;
}
- listView.Sort();
+ ListView.Sort();
}
- private void onViewObjects(object sender, EventArgs e)
+ void OnViewObjects(object sender, EventArgs e)
{
- if (listView.SelectedItems.Count == 1)
+ if (ListView.SelectedItems.Count == 1)
{
- if (OnViewObject != null)
- OnViewObject(listView.SelectedItems[0].Tag as TypeItem);
+ OnViewObject?.Invoke(ListView.SelectedItems[0].Tag as TypeItem);
}
}
public void Clear()
{
items = new Dictionary();
- listView.Items.Clear();
+ ListView.Items.Clear();
}
///
@@ -82,8 +77,7 @@ public void Clear()
///
public void UpdateTypeGrid(string[] lines)
{
- listView.SetExStyles();
- listView.BeginUpdate();
+ ListView.BeginUpdate();
foreach (TypeItem item in items.Values)
item.Zero();
@@ -97,44 +91,42 @@ public void UpdateTypeGrid(string[] lines)
{
item = new TypeItem(parts[3]);
items[parts[0]] = item;
- listView.Items.Add(item.ListItem);
+ ListView.Items.Add(item.ListItem);
}
else if (!items.ContainsKey(parts[0])) continue;
else item = items[parts[0]];
item.Update(parts[1], parts[2]);
}
- listView.Sort();
+ ListView.Sort();
}
finally
{
- listView.EndUpdate();
+ ListView.EndUpdate();
}
}
}
-
#region Model
- class TypeItemComparer : IComparer
+ class TypeItemComparer : IComparer, IComparer
{
- public int SortColumn = 0;
+ public int SortColumn;
public SortOrder Sorting;
- int IComparer.Compare(object x, object y)
- {
- TypeItem a = (TypeItem)((ListViewItem)x).Tag;
- TypeItem b = (TypeItem)((ListViewItem)y).Tag;
+ public int Compare(object x, object y) => Compare((ListViewItem) x, (ListViewItem) y);
- int comp;
- switch (SortColumn)
+ public int Compare(ListViewItem x, ListViewItem y)
+ {
+ var a = (TypeItem)x.Tag;
+ var b = (TypeItem)y.Tag;
+ var comp = SortColumn switch
{
- case TypeItem.COL_PKG: comp = a.Package.CompareTo(b.Package); break;
- case TypeItem.COL_MAX: comp = a.Maximum.CompareTo(b.Maximum); break;
- case TypeItem.COL_COUNT: comp = a.Count.CompareTo(b.Count); break;
- case TypeItem.COL_MEM: comp = a.Memory.CompareTo(b.Memory); break;
- default: comp = a.Name.CompareTo(b.Name); break;
- }
-
+ TypeItem.COL_PKG => a.Package.CompareTo(b.Package),
+ TypeItem.COL_MAX => a.Maximum.CompareTo(b.Maximum),
+ TypeItem.COL_COUNT => a.Count.CompareTo(b.Count),
+ TypeItem.COL_MEM => a.Memory.CompareTo(b.Memory),
+ _ => a.Name.CompareTo(b.Name),
+ };
return Sorting == SortOrder.Ascending ? comp : -comp;
}
}
@@ -159,15 +151,13 @@ class TypeItem
public TypeItem(string fullName)
{
QName = fullName;
- int p = fullName.IndexOf(':');
- if (p >= 0)
+ if (fullName.Contains(':', out var p))
{
Name = fullName.Substring(p + 2);
Package = fullName.Substring(0, p);
}
else Name = fullName;
- ListItem = new ListViewItem(Name);
- ListItem.Tag = this;
+ ListItem = new ListViewItem(Name) {Tag = this};
ListItem.SubItems.Add(new ListViewItem.ListViewSubItem(ListItem, Package));
ListItem.SubItems.Add(new ListViewItem.ListViewSubItem(ListItem, "0"));
ListItem.SubItems.Add(new ListViewItem.ListViewSubItem(ListItem, "0"));
@@ -201,4 +191,4 @@ public void Zero()
}
#endregion
-}
+}
\ No newline at end of file
diff --git a/External/Plugins/AS3Context/Controls/ProfilerMemView.cs b/External/Plugins/AS3Context/Controls/ProfilerMemView.cs
index 1609e020b9..4f1f17f5eb 100644
--- a/External/Plugins/AS3Context/Controls/ProfilerMemView.cs
+++ b/External/Plugins/AS3Context/Controls/ProfilerMemView.cs
@@ -1,6 +1,5 @@
using System;
using System.Collections.Generic;
-using System.Text;
using System.Windows.Forms;
using PluginCore.Localization;
using System.Drawing;
@@ -9,43 +8,41 @@ namespace AS3Context.Controls
{
class ProfilerMemView
{
- ToolStripLabel memLabel;
- Label statsLabel;
- ComboBox scaleCombo;
- const int MAX_WIDTH = 1000;
- const int MAX_HEIGHT = 400;
- private MemGraph graph;
-
- public ProfilerMemView(ToolStripLabel label, Label stats, ComboBox scale, TabPage memoryPage)
+ readonly ToolStripLabel memLabel;
+ readonly Label statsLabel;
+ readonly ComboBox scaleCombo;
+
+ public MemGraph Graph { get; }
+
+ public ProfilerMemView(ToolStripLabel label, Label stats, ComboBox scale, Control memoryPage)
{
- graph = new MemGraph();
- graph.Dock = DockStyle.Fill;
- memoryPage.Controls.Add(graph);
- graph.BringToFront();
+ Graph = new MemGraph {Dock = DockStyle.Fill};
+ memoryPage.Controls.Add(Graph);
+ Graph.BringToFront();
memLabel = label;
statsLabel = stats;
scaleCombo = scale;
scaleCombo.SelectedIndex = scaleCombo.Items.Count - 1;
- scaleCombo.SelectedIndexChanged += new EventHandler(scaleCombo_SelectedIndexChanged);
- graph.TimeScale = scaleCombo.SelectedIndex + 1;
+ scaleCombo.SelectedIndexChanged += scaleCombo_SelectedIndexChanged;
+ Graph.TimeScale = scaleCombo.SelectedIndex + 1;
Clear();
}
void scaleCombo_SelectedIndexChanged(object sender, EventArgs e)
{
- graph.TimeScale = scaleCombo.SelectedIndex + 1;
- graph.Invalidate();
+ Graph.TimeScale = scaleCombo.SelectedIndex + 1;
+ Graph.Invalidate();
}
public void Clear()
{
- graph.Values = new List();
- graph.MaxValue = 1;
- memLabel.Text = String.Format(TextHelper.GetString("Label.MemoryDisplay"), FormatMemory(0), FormatMemory(0));
- statsLabel.Text = String.Format(TextHelper.GetString("Label.MemoryStats"), "\n", FormatMemory(0), FormatMemory(0));
+ Graph.Values = new List();
+ Graph.MaxValue = 1;
+ memLabel.Text = string.Format(TextHelper.GetString("Label.MemoryDisplay"), FormatMemory(0), FormatMemory(0));
+ statsLabel.Text = string.Format(TextHelper.GetString("Label.MemoryStats"), "\n", FormatMemory(0), FormatMemory(0));
}
///
@@ -54,18 +51,17 @@ public void Clear()
///
public void UpdateStats(string[] info)
{
- int mem = 0;
- int.TryParse(info[1], out mem);
- graph.Values.Add((float)mem);
- if (mem > graph.MaxValue) graph.MaxValue = mem;
+ int.TryParse(info[1], out var mem);
+ Graph.Values.Add(mem);
+ if (mem > Graph.MaxValue) Graph.MaxValue = mem;
string raw = TextHelper.GetString("Label.MemoryDisplay");
- memLabel.Text = String.Format(raw, FormatMemory(mem), FormatMemory((int)graph.MaxValue));
+ memLabel.Text = string.Format(raw, FormatMemory(mem), FormatMemory((int)Graph.MaxValue));
raw = TextHelper.GetString("Label.MemoryStats");
- statsLabel.Text = String.Format(raw, "\n", FormatMemory(mem), FormatMemory((int)graph.MaxValue));
- graph.Invalidate();
+ statsLabel.Text = string.Format(raw, "\n", FormatMemory(mem), FormatMemory((int)Graph.MaxValue));
+ Graph.Invalidate();
}
- private string FormatMemory(int mem)
+ string FormatMemory(int mem)
{
double m = mem / 1024.0;
return (Math.Round(m * 10.0) / 10.0).ToString("N0");
@@ -77,13 +73,25 @@ class MemGraph : Control
public List Values = new List();
public float MaxValue = 1;
public int TimeScale = 4;
+ Color back;
+ Color rect;
+ Color norm;
+ Color peak;
+ Color cur;
public MemGraph()
{
- this.SetStyle(
- ControlStyles.UserPaint |
- ControlStyles.AllPaintingInWmPaint |
- ControlStyles.OptimizedDoubleBuffer, true);
+ SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);
+ UpdateColors();
+ }
+
+ public void UpdateColors()
+ {
+ rect = PluginCore.PluginBase.MainForm.GetThemeColor("MemGraph.ForeColor", Color.Gray);
+ back = PluginCore.PluginBase.MainForm.GetThemeColor("MemGraph.BackColor", Color.White);
+ norm = PluginCore.PluginBase.MainForm.GetThemeColor("MemGraph.NormalColor", Color.LightGray);
+ peak = PluginCore.PluginBase.MainForm.GetThemeColor("MemGraph.PeakColor", Color.Red);
+ cur = PluginCore.PluginBase.MainForm.GetThemeColor("MemGraph.CurrentColor", Color.Blue);
}
protected override void OnPaint(PaintEventArgs pe)
@@ -91,8 +99,8 @@ protected override void OnPaint(PaintEventArgs pe)
Graphics g = pe.Graphics;
Rectangle r = pe.ClipRectangle;
g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;
- g.FillRectangle(Brushes.White, r);
- g.DrawRectangle(Pens.Gray, 0, 0, Width - 1, Height - 1);
+ g.FillRectangle(new SolidBrush(back), r);
+ g.DrawRectangle(new Pen(rect), 0, 0, Width - 1, Height - 1);
if (Width < 8 || Height < 8) return;
@@ -103,11 +111,10 @@ protected override void OnPaint(PaintEventArgs pe)
int diff = Math.Min(Width / TimeScale, n);
int x0 = Width - diff * TimeScale;
int i = Math.Max(0, n - diff);
- float h = (float)Height;
- Pen line;
+ float h = Height;
// peak
- line = new Pen(Brushes.LightGray, 1);
+ var line = new Pen(norm, 1);
float step = 25000000f;
while (step * 4 < MaxValue) step *= 2;
float top = step;
@@ -118,21 +125,22 @@ protected override void OnPaint(PaintEventArgs pe)
g.DrawLine(line, 1f, y, Width - 2, y);
top += step;
}
- line = new Pen(Brushes.Red, 1);
+ line = new Pen(peak, 1);
y = (float)Math.Round(h * 0.1f);
g.DrawLine(line, 0f, y, Width - 1, y);
// graph
- List points = new List();
+ var points = new List();
while (i < n)
{
points.Add(new PointF(x0, h * (1f - 0.9f * Values[i] / MaxValue)));
i++;
x0 += TimeScale;
}
- line = new Pen(Brushes.Blue, 2);
- line.LineJoin = System.Drawing.Drawing2D.LineJoin.Round;
+ line = new Pen(cur, 2) {LineJoin = System.Drawing.Drawing2D.LineJoin.Round};
g.DrawLines(line, points.ToArray());
}
+
}
+
}
diff --git a/External/Plugins/AS3Context/Controls/ProfilerObjectsView.cs b/External/Plugins/AS3Context/Controls/ProfilerObjectsView.cs
index abc95f6f75..61fd012a61 100644
--- a/External/Plugins/AS3Context/Controls/ProfilerObjectsView.cs
+++ b/External/Plugins/AS3Context/Controls/ProfilerObjectsView.cs
@@ -1,82 +1,70 @@
using System;
-using System.Collections.Generic;
-using System.Text;
-using Aga.Controls.Tree;
+using System.IO;
using System.Text.RegularExpressions;
using System.Windows.Forms;
using PluginCore;
-using System.IO;
+using PluginCore.Localization;
namespace AS3Context.Controls
{
class ProfilerObjectsView
{
- ObjectRefsGrid objectsGrid;
- Regex reStep = new Regex("([^\\[]+)\\[(.*):([0-9]+)\\]");
- ObjectRefsModel model = new ObjectRefsModel();
- ToolStripMenuItem openItem;
+ readonly Regex reStep = new Regex("([^\\[]+)\\[(.*):([0-9]+)\\]");
+ readonly ObjectRefsModel model = new ObjectRefsModel();
string fileToOpen;
int lineToOpen;
- Timer delayOpen;
+ readonly Timer delayOpen;
+
+ public ObjectRefsGrid ObjectsGrid { get; }
public ProfilerObjectsView(ObjectRefsGrid grid)
{
- objectsGrid = grid;
+ ObjectsGrid = grid;
delayOpen = new Timer();
delayOpen.Interval = 100;
- delayOpen.Tick += new EventHandler(delayOpen_Tick);
+ delayOpen.Tick += delayOpen_Tick;
// action
- openItem = new ToolStripMenuItem(PluginCore.Localization.TextHelper.GetString("Label.OpenMethodFile"));
- openItem.Click += new EventHandler(objectsGrid_Open);
+ var openItem = new ToolStripMenuItem(TextHelper.GetString("Label.OpenMethodFile"));
+ openItem.Click += objectsGrid_Open;
- objectsGrid.ContextMenuStrip = new ContextMenuStrip();
- objectsGrid.ContextMenuStrip.Font = PluginBase.Settings.DefaultFont;
- objectsGrid.ContextMenuStrip.Renderer = new DockPanelStripRenderer(false);
- objectsGrid.ContextMenuStrip.Items.Add(openItem);
- objectsGrid.DoubleClick += new EventHandler(objectsGrid_Open);
+ ObjectsGrid.ContextMenuStrip = new ContextMenuStrip();
+ ObjectsGrid.ContextMenuStrip.Font = PluginBase.Settings.DefaultFont;
+ ObjectsGrid.ContextMenuStrip.Renderer = new DockPanelStripRenderer(false);
+ ObjectsGrid.ContextMenuStrip.Items.Add(openItem);
+ ObjectsGrid.DoubleClick += objectsGrid_Open;
}
void delayOpen_Tick(object sender, EventArgs e)
{
delayOpen.Stop();
- if (fileToOpen != null)
+ if (fileToOpen is null) return;
+ if (File.Exists(fileToOpen))
{
- if (File.Exists(fileToOpen))
+ PluginBase.MainForm.OpenEditableDocument(fileToOpen, false);
+ if (PluginBase.MainForm.CurrentDocument is {IsEditable: true, SciControl: { } sci} doc
+ && doc.FileName.Equals(fileToOpen, StringComparison.OrdinalIgnoreCase))
{
- PluginBase.MainForm.OpenEditableDocument(fileToOpen, false);
- if (PluginBase.MainForm.CurrentDocument.IsEditable
- && PluginBase.MainForm.CurrentDocument.FileName.Equals(fileToOpen, StringComparison.OrdinalIgnoreCase))
- {
- ScintillaNet.ScintillaControl sci = PluginBase.MainForm.CurrentDocument.SciControl;
- int pos = sci.PositionFromLine(lineToOpen);
- sci.SetSel(pos, pos);
- sci.EnsureVisible(lineToOpen);
- }
+ var pos = sci.PositionFromLine(lineToOpen);
+ sci.SetSel(pos, pos);
+ sci.EnsureVisibleEnforcePolicy(lineToOpen);
}
- fileToOpen = null;
}
+ fileToOpen = null;
}
void objectsGrid_Open(object sender, EventArgs e)
{
- if (objectsGrid.SelectedNode != null)
+ if (ObjectsGrid.SelectedNode?.Tag is ObjectRefsNode node && node.Line.Length > 0)
{
- ObjectRefsNode node = objectsGrid.SelectedNode.Tag as ObjectRefsNode;
- if (node != null && node.Line.Length > 0)
- {
- fileToOpen = node.Path.Replace(';', System.IO.Path.DirectorySeparatorChar);
- lineToOpen = int.Parse(node.Line) - 1;
- delayOpen.Start();
- }
+ fileToOpen = node.Path.Replace(';', Path.DirectorySeparatorChar);
+ lineToOpen = int.Parse(node.Line) - 1;
+ delayOpen.Start();
}
}
- public void Clear()
- {
- model.Root.Nodes.Clear();
- }
+ public void Clear() => model.Root.Nodes.Clear();
public void Display(string qname, string[] info)
{
@@ -103,7 +91,7 @@ public void Display(string qname, string[] info)
model.Root.Nodes.Add(node);
}
- objectsGrid.Model = model;
+ ObjectsGrid.Model = model;
}
}
}
diff --git a/External/Plugins/AS3Context/Controls/ProfilerUI.Designer.cs b/External/Plugins/AS3Context/Controls/ProfilerUI.Designer.cs
index 214edd588f..3c35cd20d9 100644
--- a/External/Plugins/AS3Context/Controls/ProfilerUI.Designer.cs
+++ b/External/Plugins/AS3Context/Controls/ProfilerUI.Designer.cs
@@ -29,14 +29,14 @@ protected override void Dispose(bool disposing)
private void InitializeComponent()
{
this.container = new System.Windows.Forms.Panel();
- this.tabControl = new System.Windows.Forms.TabControl();
+ this.tabControl = new System.Windows.Forms.TabControlEx();
this.memoryPage = new System.Windows.Forms.TabPage();
this.memStatsPanel = new System.Windows.Forms.Panel();
this.memStatsLabel = new System.Windows.Forms.Label();
this.memScaleLabel = new System.Windows.Forms.Label();
- this.memScaleCombo = new System.Windows.Forms.ComboBox();
+ this.memScaleCombo = new System.Windows.Forms.FlatCombo();
this.liveObjectsPage = new System.Windows.Forms.TabPage();
- this.listView = new AS3Context.Controls.ListViewXP();
+ this.listView = new System.Windows.Forms.ListViewEx();
this.typeColumn = new System.Windows.Forms.ColumnHeader();
this.pkgColumn = new System.Windows.Forms.ColumnHeader();
this.maxColumn = new System.Windows.Forms.ColumnHeader();
@@ -67,7 +67,7 @@ private void InitializeComponent()
this.container.Dock = System.Windows.Forms.DockStyle.Fill;
this.container.Location = new System.Drawing.Point(1, 26);
this.container.Name = "container";
- this.container.Padding = new System.Windows.Forms.Padding(3, 3, 2, 2);
+ this.container.Padding = new System.Windows.Forms.Padding(5, 6, 5, 6);
this.container.Size = new System.Drawing.Size(488, 338);
this.container.TabIndex = 0;
//
@@ -88,7 +88,7 @@ private void InitializeComponent()
this.memoryPage.Controls.Add(this.memStatsPanel);
this.memoryPage.Location = new System.Drawing.Point(4, 22);
this.memoryPage.Name = "memoryPage";
- this.memoryPage.Padding = new System.Windows.Forms.Padding(3);
+ this.memoryPage.Padding = new System.Windows.Forms.Padding(5);
this.memoryPage.Size = new System.Drawing.Size(475, 307);
this.memoryPage.TabIndex = 2;
this.memoryPage.Text = "Memory";
@@ -144,7 +144,7 @@ private void InitializeComponent()
this.liveObjectsPage.Controls.Add(this.listView);
this.liveObjectsPage.Location = new System.Drawing.Point(4, 22);
this.liveObjectsPage.Name = "liveObjectsPage";
- this.liveObjectsPage.Padding = new System.Windows.Forms.Padding(2, 3, 3, 2);
+ this.liveObjectsPage.Padding = new System.Windows.Forms.Padding(0);
this.liveObjectsPage.Size = new System.Drawing.Size(475, 307);
this.liveObjectsPage.TabIndex = 0;
this.liveObjectsPage.Text = "Live Objects Count";
@@ -152,7 +152,7 @@ private void InitializeComponent()
//
// listView
//
- this.listView.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
+ this.listView.BorderStyle = System.Windows.Forms.BorderStyle.None;
this.listView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.typeColumn,
this.pkgColumn,
@@ -201,7 +201,7 @@ private void InitializeComponent()
//
this.objectsPage.Location = new System.Drawing.Point(4, 22);
this.objectsPage.Name = "objectsPage";
- this.objectsPage.Padding = new System.Windows.Forms.Padding(2, 3, 3, 2);
+ this.objectsPage.Padding = new System.Windows.Forms.Padding(0);
this.objectsPage.Size = new System.Drawing.Size(475, 307);
this.objectsPage.TabIndex = 1;
this.objectsPage.Text = "Objects";
@@ -318,7 +318,7 @@ private void InitializeComponent()
#endregion
- private ListViewXP listView;
+ private System.Windows.Forms.ListView listView;
private System.Windows.Forms.Panel container;
private System.Windows.Forms.ToolStrip toolStrip;
private System.Windows.Forms.ToolStripLabel memLabel;
diff --git a/External/Plugins/AS3Context/Controls/ProfilerUI.cs b/External/Plugins/AS3Context/Controls/ProfilerUI.cs
index 652ad12b78..9628d14ff5 100644
--- a/External/Plugins/AS3Context/Controls/ProfilerUI.cs
+++ b/External/Plugins/AS3Context/Controls/ProfilerUI.cs
@@ -1,7 +1,5 @@
using System;
-using System.ComponentModel;
using System.Drawing;
-using System.Data;
using System.Text;
using System.Windows.Forms;
using PluginCore;
@@ -12,52 +10,45 @@
using System.Net.Sockets;
using System.Text.RegularExpressions;
using System.Collections.Generic;
+using System.Linq;
using WeifenLuo.WinFormsUI.Docking;
namespace AS3Context.Controls
{
- public partial class ProfilerUI : DockPanelControl
+ public partial class ProfilerUI : DockPanelControl, IThemeHandler
{
- static private readonly Byte[] RESULT_OK = Encoding.Default.GetBytes("\0");
- static private readonly Byte[] RESULT_IGNORED = Encoding.Default.GetBytes("\0");
- static private readonly Byte[] RESULT_GC = Encoding.Default.GetBytes("\0");
+ static readonly byte[] RESULT_OK = Encoding.Default.GetBytes("\0");
+ static readonly byte[] RESULT_IGNORED = Encoding.Default.GetBytes("\0");
+ static readonly byte[] RESULT_GC = Encoding.Default.GetBytes("\0");
- static private ProfilerUI instance;
- static private bool gcWanted;
- static private byte[] snapshotWanted;
+ static ProfilerUI instance;
+ static bool gcWanted;
+ static byte[] snapshotWanted;
public DockContent PanelRef;
- private bool autoStart;
- private bool running;
- private string current;
- private List previous = new List();
- private ObjectRefsGrid objectRefsGrid;
- private ProfilerLiveObjectsView liveObjectsView;
- private ProfilerMemView memView;
- private ProfilerObjectsView objectRefsView;
- private Timer detectDisconnect;
- private List profilerItems;
- private string profilerItemsCheck;
- private string profilerSWF;
-
- public bool AutoStart
- {
- get { return autoStart; }
- }
+ bool running;
+ string current;
+ readonly List previous = new List();
+ readonly ObjectRefsGrid objectRefsGrid;
+ readonly ProfilerLiveObjectsView liveObjectsView;
+ readonly ProfilerMemView memView;
+ readonly ProfilerObjectsView objectRefsView;
+ readonly Timer detectDisconnect;
+ List profilerItems;
+ string profilerItemsCheck;
+ string profilerSWF;
+
+ public bool AutoStart { get; private set; }
public static void HandleFlashConnect(object sender, object data)
{
- Socket client = sender as Socket;
-
- if (instance == null || data == null || !instance.running)
+ var client = (Socket) sender;
+ if (instance is null || data is null || !instance.running)
{
if (client.Connected) client.Send(RESULT_IGNORED);
return;
}
-
instance.OnProfileData((string)data);
-
if (client.Connected) client.Send(RESULT_OK);
-
if (gcWanted)
{
if (client.Connected) client.Send(RESULT_GC);
@@ -75,6 +66,7 @@ public static void HandleFlashConnect(object sender, object data)
public ProfilerUI()
{
instance = this;
+ AutoKeyHandling = true;
InitializeComponent();
objectRefsGrid = new ObjectRefsGrid();
@@ -92,7 +84,7 @@ public ProfilerUI()
if (PluginMain.Settings.ProfilerTimeout == 0) PluginMain.Settings.ProfilerTimeout = 30;
detectDisconnect = new Timer();
detectDisconnect.Interval = Math.Max(5, PluginMain.Settings.ProfilerTimeout) * 1000;
- detectDisconnect.Tick += new EventHandler(detectDisconnect_Tick);
+ detectDisconnect.Tick += detectDisconnect_Tick;
memView = new ProfilerMemView(memLabel, memStatsLabel, memScaleCombo, memoryPage);
@@ -100,14 +92,24 @@ public ProfilerUI()
column.Width = ScaleHelper.Scale(column.Width);
liveObjectsView = new ProfilerLiveObjectsView(listView);
- liveObjectsView.OnViewObject += new ViewObjectEvent(liveObjectsView_OnViewObject);
+ liveObjectsView.OnViewObject += liveObjectsView_OnViewObject;
objectRefsView = new ProfilerObjectsView(objectRefsGrid);
- configureProfilerChooser();
+ ConfigureProfilerChooser();
StopProfiling();
}
+ ///
+ /// Lets do some theming fixes
+ ///
+ public void AfterTheming()
+ {
+ this.memStatsPanel.BackColor = Color.Empty;
+ this.container.BackColor = PluginBase.MainForm.GetThemeColor("Form.BackColor", SystemColors.Control);
+ this.memView.Graph.UpdateColors();
+ }
+
void liveObjectsView_OnViewObject(TypeItem item)
{
snapshotWanted = Encoding.Default.GetBytes(" \0");
@@ -115,7 +117,7 @@ void liveObjectsView_OnViewObject(TypeItem item)
tabControl.SelectedTab = objectsPage;
}
- private void InitializeLocalization()
+ void InitializeLocalization()
{
this.labelTarget.Text = "";
this.autoButton.Text = TextHelper.GetString("Label.AutoStartProfilerOFF");
@@ -145,13 +147,13 @@ public void Cleanup()
SetProfilerCfg(false);
}
- private void runButton_Click(object sender, EventArgs e)
+ void runButton_Click(object sender, EventArgs e)
{
if (running) StopProfiling();
else StartProfiling();
}
- private void gcButton_Click(object sender, EventArgs e)
+ void gcButton_Click(object sender, EventArgs e)
{
if (running && current != null) gcWanted = true;
}
@@ -183,50 +185,48 @@ public void StartProfiling()
gcButton.Enabled = false;
if (!SetProfilerCfg(true)) StopProfiling();
- else if (autoStart)
+ else if (AutoStart)
{
detectDisconnect.Interval = 5000; // expecting connection before 5s
detectDisconnect.Start();
}
}
- private void autoButton_Click(object sender, EventArgs e)
+ void autoButton_Click(object sender, EventArgs e)
{
- autoStart = !autoStart;
- autoButton.Image = PluginBase.MainForm.FindImage(autoStart ? "510" : "514");
- autoButton.Text = TextHelper.GetString(autoStart ? "Label.AutoStartProfilerON" : "Label.AutoStartProfilerOFF");
+ AutoStart = !AutoStart;
+ autoButton.Image = PluginBase.MainForm.FindImage(AutoStart ? "510" : "514");
+ autoButton.Text = TextHelper.GetString(AutoStart ? "Label.AutoStartProfilerON" : "Label.AutoStartProfilerOFF");
}
#endregion
#region Profiler selector
- private void configureProfilerChooser()
+ void ConfigureProfilerChooser()
{
profilerChooser.Image = PluginBase.MainForm.FindImage("274");
- profilerChooser.DropDownOpening += new EventHandler(profilerChooser_DropDownOpening);
+ profilerChooser.DropDownOpening += ProfilerChooser_DropDownOpening;
profilerItems = new List();
defaultToolStripMenuItem.Checked = true;
- defaultToolStripMenuItem.Click += new EventHandler(changeProfiler_Click);
+ defaultToolStripMenuItem.Click += ChangeProfiler_Click;
profilerSWF = null; // default
- string active = Path.Combine(Path.Combine(PathHelper.DataDir, "AS3Context"), "activeProfiler.txt");
+ var active = Path.Combine(PathHelper.DataDir, "AS3Context", "activeProfiler.txt");
if (File.Exists(active))
{
- string src = File.ReadAllText(active).Trim();
- if (src.Length > 0 && File.Exists(src))
- profilerSWF = src;
+ var src = File.ReadAllText(active).Trim();
+ if (File.Exists(src)) profilerSWF = src;
}
}
- void profilerChooser_DropDownOpening(object sender, EventArgs e)
+ void ProfilerChooser_DropDownOpening(object sender, EventArgs e)
{
- string[] swfs = PluginMain.Settings.CustomProfilers;
- if (swfs == null || swfs.Length == 0) return;
+ var swfs = PluginMain.Settings.CustomProfilers;
+ if (swfs.IsNullOrEmpty()) return;
- string check = "";
- foreach(string swf in swfs) check += swf;
+ var check = swfs.Aggregate("", (current1, swf) => current1 + swf);
if (check == profilerItemsCheck) return;
profilerItemsCheck = check;
@@ -239,7 +239,7 @@ void profilerChooser_DropDownOpening(object sender, EventArgs e)
{
ToolStripMenuItem item = new ToolStripMenuItem(Path.GetFileNameWithoutExtension(swf));
item.Tag = swf;
- item.Click += new EventHandler(changeProfiler_Click);
+ item.Click += ChangeProfiler_Click;
profilerItems.Add(item);
}
}
@@ -247,24 +247,24 @@ void profilerChooser_DropDownOpening(object sender, EventArgs e)
profilerChooser.DropDownItems.AddRange(profilerItems.ToArray());
defaultToolStripMenuItem.Checked = false;
foreach (ToolStripMenuItem item in profilerItems)
- if (item.Tag as String == profilerSWF)
+ if (item.Tag as string == profilerSWF)
{
item.Checked = true;
break;
}
}
- void changeProfiler_Click(object sender, EventArgs e)
+ void ChangeProfiler_Click(object sender, EventArgs e)
{
- ToolStripMenuItem item = sender as ToolStripMenuItem;
- if (item == null || item.Checked) return;
+ var item = sender as ToolStripMenuItem;
+ if (item is null || item.Checked) return;
- foreach (ToolStripMenuItem it in profilerItems)
+ foreach (var it in profilerItems)
it.Checked = false;
item.Checked = true;
- profilerSWF = item.Tag as String;
+ profilerSWF = item.Tag as string;
- string active = Path.Combine(Path.Combine(PathHelper.DataDir, "AS3Context"), "activeProfiler.txt");
+ var active = Path.Combine(PathHelper.DataDir, "AS3Context", "activeProfiler.txt");
File.WriteAllText(active, profilerSWF ?? "");
}
@@ -318,14 +318,13 @@ internal bool OnProfileData(string data)
#region MM configuration
- private bool SetProfilerCfg(bool active)
+ bool SetProfilerCfg(bool active)
{
try
{
- String mmCfg = PathHelper.ResolveMMConfig();
+ var mmCfg = PathHelper.ResolveMMConfig();
if (!File.Exists(mmCfg)) CreateDefaultCfg(mmCfg);
-
- string src = File.ReadAllText(mmCfg).Trim();
+ var src = File.ReadAllText(mmCfg).Trim();
src = Regex.Replace(src, "PreloadSwf=.*", "").Trim();
if (active)
{
@@ -340,67 +339,59 @@ private bool SetProfilerCfg(bool active)
return true;
}
- private string AddDefaultProfiler()
+ static string AddDefaultProfiler()
{
string swfPath = ResolvePath(CheckResource("Profiler5.swf", "Profiler.swf"));
ASCompletion.Commands.CreateTrustFile.Run("FDProfiler.cfg", Path.GetDirectoryName(swfPath));
- FlashConnect.Settings settings = GetFlashConnectSettings();
+ var settings = GetFlashConnectSettings();
return "\r\nPreloadSwf=" + swfPath + "?host=" + settings.Host + "&port=" + settings.Port + "\r\n";
}
- private string AddCustomProfiler()
+ string AddCustomProfiler()
{
- string swfPath = ResolvePath(profilerSWF);
- if (swfPath == null) return null;
- ASCompletion.Commands.CreateTrustFile.Run("FDProfiler.cfg", Path.GetDirectoryName(swfPath));
- return "\r\nPreloadSwf=" + swfPath + "\r\n";
+ var path = ResolvePath(profilerSWF);
+ if (path is null) return null;
+ ASCompletion.Commands.CreateTrustFile.Run("FDProfiler.cfg", Path.GetDirectoryName(path));
+ return "\r\nPreloadSwf=" + path + "\r\n";
}
- private string ResolvePath(string path)
+ static string ResolvePath(string path)
{
- if (PluginBase.CurrentProject != null)
- return PathHelper.ResolvePath(path, Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath));
- else
- return PathHelper.ResolvePath(path);
+ return PluginBase.CurrentProject != null
+ ? PathHelper.ResolvePath(path, Path.GetDirectoryName(PluginBase.CurrentProject.ProjectPath))
+ : PathHelper.ResolvePath(path);
}
- private FlashConnect.Settings GetFlashConnectSettings()
+ static FlashConnect.Settings GetFlashConnectSettings()
{
- IPlugin flashConnect = PluginBase.MainForm.FindPlugin("425ae753-fdc2-4fdf-8277-c47c39c2e26b");
- return flashConnect != null ? (FlashConnect.Settings)flashConnect.Settings : new FlashConnect.Settings();
+ var plugin = PluginBase.MainForm.FindPlugin("425ae753-fdc2-4fdf-8277-c47c39c2e26b");
+ return plugin != null ? (FlashConnect.Settings)plugin.Settings : new FlashConnect.Settings();
}
- static private string CheckResource(string fileName, string resName)
+ static string CheckResource(string fileName, string resName)
{
- string path = Path.Combine(PathHelper.DataDir, "AS3Context");
- string fullPath = Path.Combine(path, fileName);
- if (!File.Exists(fullPath))
+ var fullPath = Path.Combine(PathHelper.DataDir, "AS3Context", fileName);
+ if (File.Exists(fullPath)) return fullPath;
+ var id = "AS3Context.Resources." + resName;
+ var assembly = System.Reflection.Assembly.GetExecutingAssembly();
+ using var br = new BinaryReader(assembly.GetManifestResourceStream(id));
+ using var bw = File.Create(fullPath);
+ var buffer = br.ReadBytes(1024);
+ while (buffer.Length > 0)
{
- string id = "AS3Context.Resources." + resName;
- System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
- using (BinaryReader br = new BinaryReader(assembly.GetManifestResourceStream(id)))
- {
- using (FileStream bw = File.Create(fullPath))
- {
- byte[] buffer = br.ReadBytes(1024);
- while (buffer.Length > 0)
- {
- bw.Write(buffer, 0, buffer.Length);
- buffer = br.ReadBytes(1024);
- }
- bw.Close();
- }
- br.Close();
- }
+ bw.Write(buffer, 0, buffer.Length);
+ buffer = br.ReadBytes(1024);
}
+ bw.Close();
+ br.Close();
return fullPath;
}
- private void CreateDefaultCfg(string mmCfg)
+ static void CreateDefaultCfg(string mmCfg)
{
try
{
- String contents = "PolicyFileLog=1\r\nPolicyFileLogAppend=0\r\nErrorReportingEnable=1\r\nTraceOutputFileEnable=1\r\n";
+ const string contents = "PolicyFileLog=1\r\nPolicyFileLogAppend=0\r\nErrorReportingEnable=1\r\nTraceOutputFileEnable=1\r\n";
FileHelper.WriteFile(mmCfg, contents, Encoding.UTF8);
}
catch (Exception ex)
@@ -412,7 +403,4 @@ private void CreateDefaultCfg(string mmCfg)
#endregion
}
-
-
-
-}
+}
\ No newline at end of file
diff --git a/External/Plugins/AS3Context/Controls/Win32.cs b/External/Plugins/AS3Context/Controls/Win32.cs
index 56995cda80..a2a1d30c6f 100644
--- a/External/Plugins/AS3Context/Controls/Win32.cs
+++ b/External/Plugins/AS3Context/Controls/Win32.cs
@@ -6,77 +6,66 @@
namespace AS3Context.Controls
{
- #region LVS_EX
+ public enum LVM
+ {
+ LVM_FIRST =0x1000,
+ LVM_SETEXTENDEDLISTVIEWSTYLE=(LVM_FIRST + 54),
+ LVM_GETEXTENDEDLISTVIEWSTYLE=(LVM_FIRST + 55),
+ }
public enum LVS_EX
- {
- LVS_EX_GRIDLINES =0x00000001,
- LVS_EX_SUBITEMIMAGES =0x00000002,
- LVS_EX_CHECKBOXES =0x00000004,
- LVS_EX_TRACKSELECT =0x00000008,
- LVS_EX_HEADERDRAGDROP =0x00000010,
- LVS_EX_FULLROWSELECT =0x00000020,
- LVS_EX_ONECLICKACTIVATE =0x00000040,
- LVS_EX_TWOCLICKACTIVATE =0x00000080,
- LVS_EX_FLATSB =0x00000100,
- LVS_EX_REGIONAL =0x00000200,
- LVS_EX_INFOTIP =0x00000400,
- LVS_EX_UNDERLINEHOT =0x00000800,
- LVS_EX_UNDERLINECOLD =0x00001000,
- LVS_EX_MULTIWORKAREAS =0x00002000,
- LVS_EX_LABELTIP =0x00004000,
- LVS_EX_BORDERSELECT =0x00008000,
- LVS_EX_DOUBLEBUFFER =0x00010000,
- LVS_EX_HIDELABELS =0x00020000,
- LVS_EX_SINGLEROW =0x00040000,
- LVS_EX_SNAPTOGRID =0x00080000,
- LVS_EX_SIMPLESELECT =0x00100000
- }
- #endregion
+ {
+ LVS_EX_GRIDLINES =0x00000001,
+ LVS_EX_SUBITEMIMAGES =0x00000002,
+ LVS_EX_CHECKBOXES =0x00000004,
+ LVS_EX_TRACKSELECT =0x00000008,
+ LVS_EX_HEADERDRAGDROP =0x00000010,
+ LVS_EX_FULLROWSELECT =0x00000020,
+ LVS_EX_ONECLICKACTIVATE =0x00000040,
+ LVS_EX_TWOCLICKACTIVATE =0x00000080,
+ LVS_EX_FLATSB =0x00000100,
+ LVS_EX_REGIONAL =0x00000200,
+ LVS_EX_INFOTIP =0x00000400,
+ LVS_EX_UNDERLINEHOT =0x00000800,
+ LVS_EX_UNDERLINECOLD =0x00001000,
+ LVS_EX_MULTIWORKAREAS =0x00002000,
+ LVS_EX_LABELTIP =0x00004000,
+ LVS_EX_BORDERSELECT =0x00008000,
+ LVS_EX_DOUBLEBUFFER =0x00010000,
+ LVS_EX_HIDELABELS =0x00020000,
+ LVS_EX_SINGLEROW =0x00040000,
+ LVS_EX_SNAPTOGRID =0x00080000,
+ LVS_EX_SIMPLESELECT =0x00100000
+ }
- #region LVM
- public enum LVM
- {
- LVM_FIRST =0x1000,
- LVM_SETEXTENDEDLISTVIEWSTYLE=(LVM_FIRST + 54),
- LVM_GETEXTENDEDLISTVIEWSTYLE=(LVM_FIRST + 55),
- }
- #endregion
+ [ToolboxBitmap(typeof(System.Windows.Forms.ListViewEx))]
+ public class ListViewXP : System.Windows.Forms.ListViewEx
+ {
+ private LVS_EX styles;
+ public ListViewXP(){}
- [ToolboxBitmap(typeof(System.Windows.Forms.ListView))]
- public class ListViewXP :System.Windows.Forms.ListView
- {
- [DllImport("user32.dll", CharSet=CharSet.Auto)]
- public static extern int SendMessage(IntPtr handle, int messg, int wparam, int lparam);
+ ///
+ /// Sets Double_Buffering and BorderSelect style
+ ///
+ public void SetExStyles()
+ {
+ if (!PluginCore.Win32.ShouldUseWin32()) return;
+ styles = (LVS_EX)PluginCore.Win32.SendMessage(this.Handle, (int) LVM.LVM_GETEXTENDEDLISTVIEWSTYLE, 0,0);
+ styles |= LVS_EX.LVS_EX_DOUBLEBUFFER | LVS_EX.LVS_EX_BORDERSELECT;
+ PluginCore.Win32.SendMessage(this.Handle, (int)LVM.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (int)styles);
+ }
-
- private LVS_EX styles;
-
- public ListViewXP()
- {
-
- }
-
- ///
- /// Sets Double_Buffering and BorderSelect style
- ///
- public void SetExStyles()
- {
- styles = (LVS_EX)SendMessage(this.Handle, (int) LVM.LVM_GETEXTENDEDLISTVIEWSTYLE, 0,0);
- styles |= LVS_EX.LVS_EX_DOUBLEBUFFER | LVS_EX.LVS_EX_BORDERSELECT;
- SendMessage(this.Handle, (int) LVM.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (int) styles);
- }
-
- ///
- /// Sets ListViewExtended Styles
- ///
- /// The Styles you wish to set.
- public void SetExStyles(LVS_EX exStyle)
- {
- styles = (LVS_EX)SendMessage(this.Handle, (int) LVM.LVM_GETEXTENDEDLISTVIEWSTYLE, 0,0);
- styles |= exStyle;
- SendMessage(this.Handle, (int) LVM.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (int) styles);
- }
-
- }
+ ///
+ /// Sets ListViewExtended Styles
+ ///
+ /// The Styles you wish to set.
+ public void SetExStyles(LVS_EX exStyle)
+ {
+ if (!PluginCore.Win32.ShouldUseWin32()) return;
+ styles = (LVS_EX)PluginCore.Win32.SendMessage(this.Handle, (int)LVM.LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0);
+ styles |= exStyle;
+ PluginCore.Win32.SendMessage(this.Handle, (int)LVM.LVM_SETEXTENDEDLISTVIEWSTYLE, 0, (int)styles);
+ }
+
+ }
}
diff --git a/External/Plugins/AS3Context/Grammar/AS3Lexer.cs b/External/Plugins/AS3Context/Grammar/AS3Lexer.cs
index 46d7a62cd9..1cb597c58d 100644
--- a/External/Plugins/AS3Context/Grammar/AS3Lexer.cs
+++ b/External/Plugins/AS3Context/Grammar/AS3Lexer.cs
@@ -34,2898 +34,2898 @@
namespace AS3Context.Grammar
{
- // Generate header specific to lexer CSharp file
- using System;
- using Stream = System.IO.Stream;
- using TextReader = System.IO.TextReader;
- using Hashtable = System.Collections.Hashtable;
- using Comparer = System.Collections.Comparer;
-
- using TokenStreamException = antlr.TokenStreamException;
- using TokenStreamIOException = antlr.TokenStreamIOException;
- using TokenStreamRecognitionException = antlr.TokenStreamRecognitionException;
- using CharStreamException = antlr.CharStreamException;
- using CharStreamIOException = antlr.CharStreamIOException;
- using ANTLRException = antlr.ANTLRException;
- using CharScanner = antlr.CharScanner;
- using InputBuffer = antlr.InputBuffer;
- using ByteBuffer = antlr.ByteBuffer;
- using CharBuffer = antlr.CharBuffer;
- using Token = antlr.Token;
- using IToken = antlr.IToken;
- using CommonToken = antlr.CommonToken;
- using SemanticException = antlr.SemanticException;
- using RecognitionException = antlr.RecognitionException;
- using NoViableAltForCharException = antlr.NoViableAltForCharException;
- using MismatchedCharException = antlr.MismatchedCharException;
- using TokenStream = antlr.TokenStream;
- using LexerSharedInputState = antlr.LexerSharedInputState;
- using BitSet = antlr.collections.impl.BitSet;
-
- public class AS3Lexer : antlr.CharScanner , TokenStream
- {
- public const int EOF = 1;
- public const int NULL_TREE_LOOKAHEAD = 3;
- public const int COMPILATION_UNIT = 4;
- public const int IMPORT = 5;
- public const int CLASS_DEF = 6;
- public const int INTERFACE_DEF = 7;
- public const int EXTENDS_CLAUSE = 8;
- public const int IMPLEMENTS_CLAUSE = 9;
- public const int TYPE_BLOCK = 10;
- public const int MODIFIERS = 11;
- public const int VARIABLE_DEF = 12;
- public const int METHOD_DEF = 13;
- public const int NAMESPACE_DEF = 14;
- public const int PARAMS = 15;
- public const int PARAM = 16;
- public const int TYPE_SPEC = 17;
- public const int BLOCK = 18;
- public const int EXPR = 19;
- public const int ELIST = 20;
- public const int EXPR_STMNT = 21;
- public const int NEW_EXPR = 22;
- public const int ENCPS_EXPR = 23;
- public const int VAR_INIT = 24;
- public const int METHOD_CALL = 25;
- public const int ARRAY_ACC = 26;
- public const int UNARY_PLUS = 27;
- public const int UNARY_MINUS = 28;
- public const int POST_INC = 29;
- public const int POST_DEC = 30;
- public const int ARRAY_LITERAL = 31;
- public const int ELEMENT = 32;
- public const int OBJECT_LITERAL = 33;
- public const int OBJECT_FIELD = 34;
- public const int FUNC_DEF = 35;
- public const int FOR_INIT = 36;
- public const int FOR_CONDITION = 37;
- public const int FOR_ITERATOR = 38;
- public const int LITERAL_package = 39;
- public const int LCURLY = 40;
- public const int SEMI = 41;
- public const int RCURLY = 42;
- public const int LITERAL_import = 43;
- public const int LBRACK = 44;
- public const int COMMA = 45;
- public const int RBRACK = 46;
- public const int LPAREN = 47;
- public const int RPAREN = 48;
- public const int LITERAL_class = 49;
- public const int LITERAL_interface = 50;
- public const int LITERAL_extends = 51;
- public const int LITERAL_implements = 52;
- public const int LITERAL_function = 53;
- public const int LITERAL_get = 54;
- public const int LITERAL_set = 55;
- // "/n" = 56
- // "/r" = 57
- public const int IDENT = 58;
- public const int LITERAL_namespace = 59;
- public const int LITERAL_var = 60;
- public const int LITERAL_const = 61;
- public const int ASSIGN = 62;
- public const int REST = 63;
- public const int LITERAL_while = 64;
- public const int LITERAL_do = 65;
- public const int LITERAL_with = 66;
- public const int LITERAL_if = 67;
- public const int LITERAL_else = 68;
- public const int LITERAL_throw = 69;
- public const int LITERAL_return = 70;
- public const int LITERAL_continue = 71;
- public const int LITERAL_break = 72;
- public const int LITERAL_switch = 73;
- public const int LITERAL_case = 74;
- public const int COLON = 75;
- public const int LITERAL_default = 76;
- public const int LITERAL_for = 77;
- public const int LITERAL_each = 78;
- public const int LITERAL_in = 79;
- public const int DOT = 80;
- public const int STAR = 81;
- public const int LITERAL_public = 82;
- public const int LITERAL_private = 83;
- public const int LITERAL_protected = 84;
- public const int LITERAL_internal = 85;
- public const int LITERAL_static = 86;
- public const int LITERAL_final = 87;
- public const int LITERAL_enumerable = 88;
- public const int LITERAL_explicit = 89;
- public const int LITERAL_override = 90;
- public const int LITERAL_dynamic = 91;
- public const int NUMBER = 92;
- public const int STAR_ASSIGN = 93;
- public const int DIV_ASSIGN = 94;
- public const int MOD_ASSIGN = 95;
- public const int PLUS_ASSIGN = 96;
- public const int MINUS_ASSIGN = 97;
- public const int SL_ASSIGN = 98;
- public const int SR_ASSIGN = 99;
- public const int BSR_ASSIGN = 100;
- public const int BAND_ASSIGN = 101;
- public const int BXOR_ASSIGN = 102;
- public const int BOR_ASSIGN = 103;
- public const int LAND_ASSIGN = 104;
- public const int LOR_ASSIGN = 105;
- public const int QUESTION = 106;
- public const int LOR = 107;
- public const int LAND = 108;
- public const int BOR = 109;
- public const int BXOR = 110;
- public const int BAND = 111;
- public const int STRICT_EQUAL = 112;
- public const int STRICT_NOT_EQUAL = 113;
- public const int NOT_EQUAL = 114;
- public const int EQUAL = 115;
- public const int LWT = 116;
- public const int GT = 117;
- public const int LE = 118;
- public const int GE = 119;
- public const int LITERAL_is = 120;
- public const int LITERAL_as = 121;
- public const int SL = 122;
- public const int SR = 123;
- public const int BSR = 124;
- public const int PLUS = 125;
- public const int MINUS = 126;
- public const int DIV = 127;
- public const int MOD = 128;
- public const int INC = 129;
- public const int DEC = 130;
- public const int LITERAL_delete = 131;
- public const int LITERAL_typeof = 132;
- public const int LNOT = 133;
- public const int BNOT = 134;
- public const int E4X_DESC = 135;
- public const int E4X_ATTRI = 136;
- public const int LITERAL_null = 137;
- public const int LITERAL_true = 138;
- public const int LITERAL_false = 139;
- public const int LITERAL_undefined = 140;
- public const int STRING_LITERAL = 141;
- public const int REGEX_LITERAL = 142;
- public const int XML_LITERAL = 143;
- public const int LITERAL_new = 144;
- public const int DBL_COLON = 145;
- public const int XML_ATTRIBUTE = 146;
- public const int XML_BINDING = 147;
- public const int XML_AS3_EXPRESSION = 148;
- public const int XML_TEXTNODE = 149;
- public const int XML_COMMENT = 150;
- public const int XML_CDATA = 151;
- public const int REGEX_BODY = 152;
- public const int WS = 153;
- public const int NL = 154;
- public const int BOM = 155;
- public const int SL_COMMENT = 156;
- public const int ML_COMMENT = 157;
- public const int EXPONENT = 158;
- public const int HEX_DIGIT = 159;
- public const int ESC = 160;
-
- public AS3Lexer(Stream ins) : this(new ByteBuffer(ins))
- {
- }
-
- public AS3Lexer(TextReader r) : this(new CharBuffer(r))
- {
- }
-
- public AS3Lexer(InputBuffer ib) : this(new LexerSharedInputState(ib))
- {
- }
-
- public AS3Lexer(LexerSharedInputState state) : base(state)
- {
- initialize();
- }
- private void initialize()
- {
- caseSensitiveLiterals = true;
- setCaseSensitive(true);
- literals = new Hashtable(100, (float) 0.4, null, Comparer.Default);
- literals.Add("public", 82);
- literals.Add("namespace", 59);
- literals.Add("case", 74);
- literals.Add("break", 72);
- literals.Add("while", 64);
- literals.Add("delete", 131);
- literals.Add("new", 144);
- literals.Add("/r", 57);
- literals.Add("implements", 52);
- literals.Add("typeof", 132);
- literals.Add("const", 61);
- literals.Add("package", 39);
- literals.Add("return", 70);
- literals.Add("throw", 69);
- literals.Add("var", 60);
- literals.Add("null", 137);
- literals.Add("protected", 84);
- literals.Add("class", 49);
- literals.Add("do", 65);
- literals.Add("function", 53);
- literals.Add("each", 78);
- literals.Add("with", 66);
- literals.Add("set", 55);
- literals.Add("/n", 56);
- literals.Add("dynamic", 91);
- literals.Add("interface", 50);
- literals.Add("is", 120);
- literals.Add("internal", 85);
- literals.Add("final", 87);
- literals.Add("explicit", 89);
- literals.Add("if", 67);
- literals.Add("override", 90);
- literals.Add("as", 121);
- literals.Add("for", 77);
- literals.Add("extends", 51);
- literals.Add("private", 83);
- literals.Add("default", 76);
- literals.Add("false", 139);
- literals.Add("static", 86);
- literals.Add("undefined", 140);
- literals.Add("get", 54);
- literals.Add("continue", 71);
- literals.Add("enumerable", 88);
- literals.Add("else", 68);
- literals.Add("import", 43);
- literals.Add("in", 79);
- literals.Add("switch", 73);
- literals.Add("true", 138);
- }
-
- override public IToken nextToken() //throws TokenStreamException
- {
- IToken theRetToken = null;
+ // Generate header specific to lexer CSharp file
+ using System;
+ using Stream = System.IO.Stream;
+ using TextReader = System.IO.TextReader;
+ using Hashtable = System.Collections.Hashtable;
+ using Comparer = System.Collections.Comparer;
+
+ using TokenStreamException = antlr.TokenStreamException;
+ using TokenStreamIOException = antlr.TokenStreamIOException;
+ using TokenStreamRecognitionException = antlr.TokenStreamRecognitionException;
+ using CharStreamException = antlr.CharStreamException;
+ using CharStreamIOException = antlr.CharStreamIOException;
+ using ANTLRException = antlr.ANTLRException;
+ using CharScanner = antlr.CharScanner;
+ using InputBuffer = antlr.InputBuffer;
+ using ByteBuffer = antlr.ByteBuffer;
+ using CharBuffer = antlr.CharBuffer;
+ using Token = antlr.Token;
+ using IToken = antlr.IToken;
+ using CommonToken = antlr.CommonToken;
+ using SemanticException = antlr.SemanticException;
+ using RecognitionException = antlr.RecognitionException;
+ using NoViableAltForCharException = antlr.NoViableAltForCharException;
+ using MismatchedCharException = antlr.MismatchedCharException;
+ using TokenStream = antlr.TokenStream;
+ using LexerSharedInputState = antlr.LexerSharedInputState;
+ using BitSet = antlr.collections.impl.BitSet;
+
+ public class AS3Lexer : antlr.CharScanner , TokenStream
+ {
+ public const int EOF = 1;
+ public const int NULL_TREE_LOOKAHEAD = 3;
+ public const int COMPILATION_UNIT = 4;
+ public const int IMPORT = 5;
+ public const int CLASS_DEF = 6;
+ public const int INTERFACE_DEF = 7;
+ public const int EXTENDS_CLAUSE = 8;
+ public const int IMPLEMENTS_CLAUSE = 9;
+ public const int TYPE_BLOCK = 10;
+ public const int MODIFIERS = 11;
+ public const int VARIABLE_DEF = 12;
+ public const int METHOD_DEF = 13;
+ public const int NAMESPACE_DEF = 14;
+ public const int PARAMS = 15;
+ public const int PARAM = 16;
+ public const int TYPE_SPEC = 17;
+ public const int BLOCK = 18;
+ public const int EXPR = 19;
+ public const int ELIST = 20;
+ public const int EXPR_STMNT = 21;
+ public const int NEW_EXPR = 22;
+ public const int ENCPS_EXPR = 23;
+ public const int VAR_INIT = 24;
+ public const int METHOD_CALL = 25;
+ public const int ARRAY_ACC = 26;
+ public const int UNARY_PLUS = 27;
+ public const int UNARY_MINUS = 28;
+ public const int POST_INC = 29;
+ public const int POST_DEC = 30;
+ public const int ARRAY_LITERAL = 31;
+ public const int ELEMENT = 32;
+ public const int OBJECT_LITERAL = 33;
+ public const int OBJECT_FIELD = 34;
+ public const int FUNC_DEF = 35;
+ public const int FOR_INIT = 36;
+ public const int FOR_CONDITION = 37;
+ public const int FOR_ITERATOR = 38;
+ public const int LITERAL_package = 39;
+ public const int LCURLY = 40;
+ public const int SEMI = 41;
+ public const int RCURLY = 42;
+ public const int LITERAL_import = 43;
+ public const int LBRACK = 44;
+ public const int COMMA = 45;
+ public const int RBRACK = 46;
+ public const int LPAREN = 47;
+ public const int RPAREN = 48;
+ public const int LITERAL_class = 49;
+ public const int LITERAL_interface = 50;
+ public const int LITERAL_extends = 51;
+ public const int LITERAL_implements = 52;
+ public const int LITERAL_function = 53;
+ public const int LITERAL_get = 54;
+ public const int LITERAL_set = 55;
+ // "/n" = 56
+ // "/r" = 57
+ public const int IDENT = 58;
+ public const int LITERAL_namespace = 59;
+ public const int LITERAL_var = 60;
+ public const int LITERAL_const = 61;
+ public const int ASSIGN = 62;
+ public const int REST = 63;
+ public const int LITERAL_while = 64;
+ public const int LITERAL_do = 65;
+ public const int LITERAL_with = 66;
+ public const int LITERAL_if = 67;
+ public const int LITERAL_else = 68;
+ public const int LITERAL_throw = 69;
+ public const int LITERAL_return = 70;
+ public const int LITERAL_continue = 71;
+ public const int LITERAL_break = 72;
+ public const int LITERAL_switch = 73;
+ public const int LITERAL_case = 74;
+ public const int COLON = 75;
+ public const int LITERAL_default = 76;
+ public const int LITERAL_for = 77;
+ public const int LITERAL_each = 78;
+ public const int LITERAL_in = 79;
+ public const int DOT = 80;
+ public const int STAR = 81;
+ public const int LITERAL_public = 82;
+ public const int LITERAL_private = 83;
+ public const int LITERAL_protected = 84;
+ public const int LITERAL_internal = 85;
+ public const int LITERAL_static = 86;
+ public const int LITERAL_final = 87;
+ public const int LITERAL_enumerable = 88;
+ public const int LITERAL_explicit = 89;
+ public const int LITERAL_override = 90;
+ public const int LITERAL_dynamic = 91;
+ public const int NUMBER = 92;
+ public const int STAR_ASSIGN = 93;
+ public const int DIV_ASSIGN = 94;
+ public const int MOD_ASSIGN = 95;
+ public const int PLUS_ASSIGN = 96;
+ public const int MINUS_ASSIGN = 97;
+ public const int SL_ASSIGN = 98;
+ public const int SR_ASSIGN = 99;
+ public const int BSR_ASSIGN = 100;
+ public const int BAND_ASSIGN = 101;
+ public const int BXOR_ASSIGN = 102;
+ public const int BOR_ASSIGN = 103;
+ public const int LAND_ASSIGN = 104;
+ public const int LOR_ASSIGN = 105;
+ public const int QUESTION = 106;
+ public const int LOR = 107;
+ public const int LAND = 108;
+ public const int BOR = 109;
+ public const int BXOR = 110;
+ public const int BAND = 111;
+ public const int STRICT_EQUAL = 112;
+ public const int STRICT_NOT_EQUAL = 113;
+ public const int NOT_EQUAL = 114;
+ public const int EQUAL = 115;
+ public const int LWT = 116;
+ public const int GT = 117;
+ public const int LE = 118;
+ public const int GE = 119;
+ public const int LITERAL_is = 120;
+ public const int LITERAL_as = 121;
+ public const int SL = 122;
+ public const int SR = 123;
+ public const int BSR = 124;
+ public const int PLUS = 125;
+ public const int MINUS = 126;
+ public const int DIV = 127;
+ public const int MOD = 128;
+ public const int INC = 129;
+ public const int DEC = 130;
+ public const int LITERAL_delete = 131;
+ public const int LITERAL_typeof = 132;
+ public const int LNOT = 133;
+ public const int BNOT = 134;
+ public const int E4X_DESC = 135;
+ public const int E4X_ATTRI = 136;
+ public const int LITERAL_null = 137;
+ public const int LITERAL_true = 138;
+ public const int LITERAL_false = 139;
+ public const int LITERAL_undefined = 140;
+ public const int STRING_LITERAL = 141;
+ public const int REGEX_LITERAL = 142;
+ public const int XML_LITERAL = 143;
+ public const int LITERAL_new = 144;
+ public const int DBL_COLON = 145;
+ public const int XML_ATTRIBUTE = 146;
+ public const int XML_BINDING = 147;
+ public const int XML_AS3_EXPRESSION = 148;
+ public const int XML_TEXTNODE = 149;
+ public const int XML_COMMENT = 150;
+ public const int XML_CDATA = 151;
+ public const int REGEX_BODY = 152;
+ public const int WS = 153;
+ public const int NL = 154;
+ public const int BOM = 155;
+ public const int SL_COMMENT = 156;
+ public const int ML_COMMENT = 157;
+ public const int EXPONENT = 158;
+ public const int HEX_DIGIT = 159;
+ public const int ESC = 160;
+
+ public AS3Lexer(Stream ins) : this(new ByteBuffer(ins))
+ {
+ }
+
+ public AS3Lexer(TextReader r) : this(new CharBuffer(r))
+ {
+ }
+
+ public AS3Lexer(InputBuffer ib) : this(new LexerSharedInputState(ib))
+ {
+ }
+
+ public AS3Lexer(LexerSharedInputState state) : base(state)
+ {
+ initialize();
+ }
+ private void initialize()
+ {
+ caseSensitiveLiterals = true;
+ setCaseSensitive(true);
+ literals = new Hashtable(100, (float) 0.4, null, Comparer.Default);
+ literals.Add("public", 82);
+ literals.Add("namespace", 59);
+ literals.Add("case", 74);
+ literals.Add("break", 72);
+ literals.Add("while", 64);
+ literals.Add("delete", 131);
+ literals.Add("new", 144);
+ literals.Add("/r", 57);
+ literals.Add("implements", 52);
+ literals.Add("typeof", 132);
+ literals.Add("const", 61);
+ literals.Add("package", 39);
+ literals.Add("return", 70);
+ literals.Add("throw", 69);
+ literals.Add("var", 60);
+ literals.Add("null", 137);
+ literals.Add("protected", 84);
+ literals.Add("class", 49);
+ literals.Add("do", 65);
+ literals.Add("function", 53);
+ literals.Add("each", 78);
+ literals.Add("with", 66);
+ literals.Add("set", 55);
+ literals.Add("/n", 56);
+ literals.Add("dynamic", 91);
+ literals.Add("interface", 50);
+ literals.Add("is", 120);
+ literals.Add("internal", 85);
+ literals.Add("final", 87);
+ literals.Add("explicit", 89);
+ literals.Add("if", 67);
+ literals.Add("override", 90);
+ literals.Add("as", 121);
+ literals.Add("for", 77);
+ literals.Add("extends", 51);
+ literals.Add("private", 83);
+ literals.Add("default", 76);
+ literals.Add("false", 139);
+ literals.Add("static", 86);
+ literals.Add("undefined", 140);
+ literals.Add("get", 54);
+ literals.Add("continue", 71);
+ literals.Add("enumerable", 88);
+ literals.Add("else", 68);
+ literals.Add("import", 43);
+ literals.Add("in", 79);
+ literals.Add("switch", 73);
+ literals.Add("true", 138);
+ }
+
+ override public IToken nextToken() //throws TokenStreamException
+ {
+ IToken theRetToken = null;
tryAgain:
- for (;;)
- {
- IToken _token = null;
- int _ttype = Token.INVALID_TYPE;
- resetText();
- try // for char stream error handling
- {
- try // for lexical error handling
- {
- switch ( cached_LA1 )
- {
- case '?':
- {
- mQUESTION(true);
- theRetToken = returnToken_;
- break;
- }
- case '(':
- {
- mLPAREN(true);
- theRetToken = returnToken_;
- break;
- }
- case ')':
- {
- mRPAREN(true);
- theRetToken = returnToken_;
- break;
- }
- case '[':
- {
- mLBRACK(true);
- theRetToken = returnToken_;
- break;
- }
- case ']':
- {
- mRBRACK(true);
- theRetToken = returnToken_;
- break;
- }
- case '{':
- {
- mLCURLY(true);
- theRetToken = returnToken_;
- break;
- }
- case '}':
- {
- mRCURLY(true);
- theRetToken = returnToken_;
- break;
- }
- case ',':
- {
- mCOMMA(true);
- theRetToken = returnToken_;
- break;
- }
- case '~':
- {
- mBNOT(true);
- theRetToken = returnToken_;
- break;
- }
- case '@':
- {
- mE4X_ATTRI(true);
- theRetToken = returnToken_;
- break;
- }
- case ';':
- {
- mSEMI(true);
- theRetToken = returnToken_;
- break;
- }
- case '$': case 'A': case 'B': case 'C':
- case 'D': case 'E': case 'F': case 'G':
- case 'H': case 'I': case 'J': case 'K':
- case 'L': case 'M': case 'N': case 'O':
- case 'P': case 'Q': case 'R': case 'S':
- case 'T': case 'U': case 'V': case 'W':
- case 'X': case 'Y': case 'Z': case '_':
- case 'a': case 'b': case 'c': case 'd':
- case 'e': case 'f': case 'g': case 'h':
- case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p':
- case 'q': case 'r': case 's': case 't':
- case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- {
- mIDENT(true);
- theRetToken = returnToken_;
- break;
- }
- case '"': case '\'':
- {
- mSTRING_LITERAL(true);
- theRetToken = returnToken_;
- break;
- }
- case '\t': case '\n': case '\u000c': case '\r':
- case ' ':
- {
- mWS(true);
- theRetToken = returnToken_;
- break;
- }
- case '.': case '0': case '1': case '2':
- case '3': case '4': case '5': case '6':
- case '7': case '8': case '9':
- {
- mNUMBER(true);
- theRetToken = returnToken_;
- break;
- }
- case '\u00bb': case '\u00bf': case '\u00ef':
- {
- mBOM(true);
- theRetToken = returnToken_;
- break;
- }
- default:
- if ((cached_LA1=='>') && (cached_LA2=='>') && (LA(3)=='>') && (LA(4)=='='))
- {
- mBSR_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='=') && (cached_LA2=='=') && (LA(3)=='=')) {
- mSTRICT_EQUAL(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='!') && (cached_LA2=='=') && (LA(3)=='=')) {
- mSTRICT_NOT_EQUAL(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='>') && (cached_LA2=='>') && (LA(3)=='=')) {
- mSR_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='>') && (cached_LA2=='>') && (LA(3)=='>') && (true)) {
- mBSR(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='<') && (cached_LA2=='<') && (LA(3)=='=')) {
- mSL_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='&') && (cached_LA2=='&') && (LA(3)=='=')) {
- mLAND_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='|') && (cached_LA2=='|') && (LA(3)=='=')) {
- mLOR_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='/') && (tokenSet_0_.member(cached_LA2)) && (tokenSet_1_.member(LA(3)))) {
- mREGEX_LITERAL(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1==':') && (cached_LA2==':')) {
- mDBL_COLON(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='=') && (cached_LA2=='=') && (true)) {
- mEQUAL(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='!') && (cached_LA2=='=') && (true)) {
- mNOT_EQUAL(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='/') && (cached_LA2=='=') && (true)) {
- mDIV_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='+') && (cached_LA2=='=')) {
- mPLUS_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='+') && (cached_LA2=='+')) {
- mINC(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='-') && (cached_LA2=='=')) {
- mMINUS_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='-') && (cached_LA2=='-')) {
- mDEC(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='*') && (cached_LA2=='=')) {
- mSTAR_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='%') && (cached_LA2=='=')) {
- mMOD_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='>') && (cached_LA2=='>') && (true)) {
- mSR(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='>') && (cached_LA2=='=')) {
- mGE(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='<') && (cached_LA2=='<') && (true)) {
- mSL(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='<') && (cached_LA2=='=')) {
- mLE(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='^') && (cached_LA2=='=')) {
- mBXOR_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='|') && (cached_LA2=='=')) {
- mBOR_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='|') && (cached_LA2=='|') && (true)) {
- mLOR(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='&') && (cached_LA2=='=')) {
- mBAND_ASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='&') && (cached_LA2=='&') && (true)) {
- mLAND(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='<') && (tokenSet_2_.member(cached_LA2))) {
- mXML_LITERAL(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='/') && (cached_LA2=='/')) {
- mSL_COMMENT(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='/') && (cached_LA2=='*')) {
- mML_COMMENT(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1==':') && (true)) {
- mCOLON(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='=') && (true)) {
- mASSIGN(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='!') && (true)) {
- mLNOT(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='/') && (true)) {
- mDIV(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='+') && (true)) {
- mPLUS(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='-') && (true)) {
- mMINUS(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='*') && (true)) {
- mSTAR(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='%') && (true)) {
- mMOD(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='>') && (true)) {
- mGT(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='<') && (true)) {
- mLWT(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='^') && (true)) {
- mBXOR(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='|') && (true)) {
- mBOR(true);
- theRetToken = returnToken_;
- }
- else if ((cached_LA1=='&') && (true)) {
- mBAND(true);
- theRetToken = returnToken_;
- }
- else
- {
- if (cached_LA1==EOF_CHAR) { uponEOF(); returnToken_ = makeToken(Token.EOF_TYPE); }
- else {throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());}
- }
- break; }
- if ( null==returnToken_ ) goto tryAgain; // found SKIP token
- _ttype = returnToken_.Type;
- returnToken_.Type = _ttype;
- return returnToken_;
- }
- catch (RecognitionException e) {
- throw new TokenStreamRecognitionException(e);
- }
- }
- catch (CharStreamException cse) {
- if ( cse is CharStreamIOException ) {
- throw new TokenStreamIOException(((CharStreamIOException)cse).io);
- }
- else {
- throw new TokenStreamException(cse.Message);
- }
- }
- }
- }
-
- public void mQUESTION(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = QUESTION;
-
- match('?');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mLPAREN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = LPAREN;
-
- match('(');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mRPAREN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = RPAREN;
-
- match(')');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mLBRACK(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = LBRACK;
-
- match('[');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mRBRACK(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = RBRACK;
-
- match(']');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mLCURLY(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = LCURLY;
-
- match('{');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mRCURLY(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = RCURLY;
-
- match('}');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mCOLON(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = COLON;
-
- match(':');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mDBL_COLON(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = DBL_COLON;
-
- match("::");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mCOMMA(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = COMMA;
-
- match(',');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = ASSIGN;
-
- match('=');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mEQUAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = EQUAL;
-
- match("==");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSTRICT_EQUAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = STRICT_EQUAL;
-
- match("===");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mLNOT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = LNOT;
-
- match('!');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mBNOT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = BNOT;
-
- match('~');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mNOT_EQUAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = NOT_EQUAL;
-
- match("!=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSTRICT_NOT_EQUAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = STRICT_NOT_EQUAL;
-
- match("!==");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mDIV(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = DIV;
-
- match('/');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mDIV_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = DIV_ASSIGN;
-
- match("/=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mPLUS(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = PLUS;
-
- match('+');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mPLUS_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = PLUS_ASSIGN;
-
- match("+=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mINC(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = INC;
-
- match("++");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mMINUS(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = MINUS;
-
- match('-');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mMINUS_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = MINUS_ASSIGN;
-
- match("-=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mDEC(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = DEC;
-
- match("--");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSTAR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = STAR;
-
- match('*');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSTAR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = STAR_ASSIGN;
-
- match("*=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mMOD(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = MOD;
-
- match('%');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mMOD_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = MOD_ASSIGN;
-
- match("%=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = SR;
-
- match(">>");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = SR_ASSIGN;
-
- match(">>=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mBSR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = BSR;
-
- match(">>>");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mBSR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = BSR_ASSIGN;
-
- match(">>>=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mGE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = GE;
-
- match(">=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mGT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = GT;
-
- match('>');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = SL;
-
- match("<<");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSL_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = SL_ASSIGN;
-
- match("<<=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mLE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = LE;
-
- match("<=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mLWT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = LWT;
-
- match('<');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mBXOR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = BXOR;
-
- match('^');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mBXOR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = BXOR_ASSIGN;
-
- match("^=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mBOR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = BOR;
-
- match('|');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mBOR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = BOR_ASSIGN;
-
- match("|=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mLOR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = LOR;
-
- match("||");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mBAND(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = BAND;
-
- match('&');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mBAND_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = BAND_ASSIGN;
-
- match("&=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mLAND(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = LAND;
-
- match("&&");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mLAND_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = LAND_ASSIGN;
-
- match("&&=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mLOR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = LOR_ASSIGN;
-
- match("||=");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mE4X_ATTRI(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = E4X_ATTRI;
-
- match('@');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSEMI(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = SEMI;
-
- match(';');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- private void mDOT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = DOT;
-
- match('.');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- private void mE4X_DESC(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = E4X_DESC;
-
- match("..");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- private void mREST(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = REST;
-
- match("...");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mIDENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = IDENT;
-
- {
- switch ( cached_LA1 )
- {
- case 'a': case 'b': case 'c': case 'd':
- case 'e': case 'f': case 'g': case 'h':
- case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p':
- case 'q': case 'r': case 's': case 't':
- case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- {
- matchRange('a','z');
- break;
- }
- case 'A': case 'B': case 'C': case 'D':
- case 'E': case 'F': case 'G': case 'H':
- case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P':
- case 'Q': case 'R': case 'S': case 'T':
- case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- {
- matchRange('A','Z');
- break;
- }
- case '_':
- {
- match('_');
- break;
- }
- case '$':
- {
- match('$');
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- }
- { // ( ... )*
- for (;;)
- {
- if (((cached_LA1 >= 'a' && cached_LA1 <= 'z')) && (true) && (true) && (true))
- {
- matchRange('a','z');
- }
- else if (((cached_LA1 >= 'A' && cached_LA1 <= 'Z')) && (true) && (true) && (true)) {
- matchRange('A','Z');
- }
- else if ((cached_LA1=='_') && (true) && (true) && (true)) {
- match('_');
- }
- else if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) {
- matchRange('0','9');
- }
- else if ((cached_LA1=='$') && (true) && (true) && (true)) {
- match('$');
- }
- else
- {
- goto _loop271_breakloop;
- }
-
- }
-_loop271_breakloop: ;
- } // ( ... )*
- _ttype = testLiteralsTable(_ttype);
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSTRING_LITERAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = STRING_LITERAL;
-
- switch ( cached_LA1 )
- {
- case '"':
- {
- match('"');
- { // ( ... )*
- for (;;)
- {
- if ((cached_LA1=='\\'))
- {
- mESC(false);
- }
- else if ((tokenSet_3_.member(cached_LA1))) {
- {
- match(tokenSet_3_);
- }
- }
- else
- {
- goto _loop275_breakloop;
- }
-
- }
-_loop275_breakloop: ;
- } // ( ... )*
- match('"');
- break;
- }
- case '\'':
- {
- match('\'');
- { // ( ... )*
- for (;;)
- {
- if ((cached_LA1=='\\'))
- {
- mESC(false);
- }
- else if ((tokenSet_4_.member(cached_LA1))) {
- {
- match(tokenSet_4_);
- }
- }
- else
- {
- goto _loop278_breakloop;
- }
-
- }
-_loop278_breakloop: ;
- } // ( ... )*
- match('\'');
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mESC(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = ESC;
-
- match('\\');
- {
- switch ( cached_LA1 )
- {
- case 'n':
- {
- match('n');
- break;
- }
- case 'r':
- {
- match('r');
- break;
- }
- case 't':
- {
- match('t');
- break;
- }
- case 'b':
- {
- match('b');
- break;
- }
- case 'f':
- {
- match('f');
- break;
- }
- case '"':
- {
- match('"');
- break;
- }
- case '\'':
- {
- match('\'');
- break;
- }
- case '\\':
- {
- match('\\');
- break;
- }
- case 'u':
- {
- { // ( ... )+
- int _cnt378=0;
- for (;;)
- {
- if ((cached_LA1=='u'))
- {
- match('u');
- }
- else
- {
- if (_cnt378 >= 1) { goto _loop378_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
- }
-
- _cnt378++;
- }
-_loop378_breakloop: ;
- } // ( ... )+
- mHEX_DIGIT(false);
- mHEX_DIGIT(false);
- mHEX_DIGIT(false);
- mHEX_DIGIT(false);
- break;
- }
- case '0': case '1': case '2': case '3':
- {
- matchRange('0','3');
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '7')) && (tokenSet_1_.member(cached_LA2)) && (true) && (true))
- {
- matchRange('0','7');
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '7')) && (tokenSet_1_.member(cached_LA2)) && (true) && (true))
- {
- matchRange('0','7');
- }
- else if ((tokenSet_1_.member(cached_LA1)) && (true) && (true) && (true)) {
- }
- else
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
-
- }
- }
- else if ((tokenSet_1_.member(cached_LA1)) && (true) && (true) && (true)) {
- }
- else
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
-
- }
- break;
- }
- case '4': case '5': case '6': case '7':
- {
- matchRange('4','7');
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '7')) && (tokenSet_1_.member(cached_LA2)) && (true) && (true))
- {
- matchRange('0','7');
- }
- else if ((tokenSet_1_.member(cached_LA1)) && (true) && (true) && (true)) {
- }
- else
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
-
- }
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mXML_LITERAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = XML_LITERAL;
-
- match('<');
- mIDENT(false);
- { // ( ... )*
- for (;;)
- {
- switch ( cached_LA1 )
- {
- case '\t': case '\n': case '\u000c': case '\r':
- case ' ':
- {
- mWS(false);
- break;
- }
- case '$': case 'A': case 'B': case 'C':
- case 'D': case 'E': case 'F': case 'G':
- case 'H': case 'I': case 'J': case 'K':
- case 'L': case 'M': case 'N': case 'O':
- case 'P': case 'Q': case 'R': case 'S':
- case 'T': case 'U': case 'V': case 'W':
- case 'X': case 'Y': case 'Z': case '_':
- case 'a': case 'b': case 'c': case 'd':
- case 'e': case 'f': case 'g': case 'h':
- case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p':
- case 'q': case 'r': case 's': case 't':
- case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- {
- mXML_ATTRIBUTE(false);
- break;
- }
- default:
- {
- goto _loop281_breakloop;
- }
- }
- }
-_loop281_breakloop: ;
- } // ( ... )*
- {
- switch ( cached_LA1 )
- {
- case '>':
- {
- match('>');
- { // ( ... )*
- for (;;)
- {
- if ((cached_LA1=='\t'||cached_LA1=='\n'||cached_LA1=='\u000c'||cached_LA1=='\r'||cached_LA1==' ') && (tokenSet_5_.member(cached_LA2)) && (tokenSet_5_.member(LA(3))) && (tokenSet_5_.member(LA(4))))
- {
- mWS(false);
- }
- else if ((tokenSet_6_.member(cached_LA1)) && (tokenSet_5_.member(cached_LA2)) && (tokenSet_5_.member(LA(3))) && (tokenSet_5_.member(LA(4)))) {
- mXML_TEXTNODE(false);
- }
- else if ((cached_LA1=='<') && (cached_LA2=='!') && (LA(3)=='-')) {
- mXML_COMMENT(false);
- }
- else if ((cached_LA1=='<') && (cached_LA2=='!') && (LA(3)=='[')) {
- mXML_CDATA(false);
- }
- else if ((cached_LA1=='<') && (tokenSet_2_.member(cached_LA2))) {
- mXML_LITERAL(false);
- }
- else
- {
- goto _loop284_breakloop;
- }
-
- }
-_loop284_breakloop: ;
- } // ( ... )*
- match("");
- mIDENT(false);
- match('>');
- break;
- }
- case '/':
- {
- match("/>");
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mWS(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = WS;
-
- { // ( ... )+
- int _cnt354=0;
- for (;;)
- {
- if ((cached_LA1==' ') && (true) && (true) && (true))
- {
- match(' ');
- }
- else if ((cached_LA1=='\t') && (true) && (true) && (true)) {
- match('\t');
- }
- else if ((cached_LA1=='\u000c') && (true) && (true) && (true)) {
- match('\f');
- }
- else if ((cached_LA1=='\n'||cached_LA1=='\r') && (true) && (true) && (true)) {
- mNL(false);
- }
- else
- {
- if (_cnt354 >= 1) { goto _loop354_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
- }
-
- _cnt354++;
- }
-_loop354_breakloop: ;
- } // ( ... )+
- if (0==inputState.guessing)
- {
- _ttype = Token.SKIP;
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mXML_ATTRIBUTE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = XML_ATTRIBUTE;
-
- mIDENT(false);
- { // ( ... )*
- for (;;)
- {
- if ((cached_LA1=='\t'||cached_LA1=='\n'||cached_LA1=='\u000c'||cached_LA1=='\r'||cached_LA1==' '))
- {
- mWS(false);
- }
- else
- {
- goto _loop287_breakloop;
- }
-
- }
-_loop287_breakloop: ;
- } // ( ... )*
- mASSIGN(false);
- { // ( ... )*
- for (;;)
- {
- if ((cached_LA1=='\t'||cached_LA1=='\n'||cached_LA1=='\u000c'||cached_LA1=='\r'||cached_LA1==' '))
- {
- mWS(false);
- }
- else
- {
- goto _loop289_breakloop;
- }
-
- }
-_loop289_breakloop: ;
- } // ( ... )*
- {
- switch ( cached_LA1 )
- {
- case '"': case '\'':
- {
- mSTRING_LITERAL(false);
- break;
- }
- case '{':
- {
- mXML_BINDING(false);
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mXML_TEXTNODE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = XML_TEXTNODE;
-
- {
- if ((cached_LA1=='\n'||cached_LA1=='\r'))
- {
- mNL(false);
- }
- else if (((cached_LA1=='/'))&&( LA(2)!='>' )) {
- match('/');
- }
- else if ((tokenSet_7_.member(cached_LA1))) {
- {
- match(tokenSet_7_);
- }
- }
- else
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
-
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mXML_COMMENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = XML_COMMENT;
-
- match("");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mXML_CDATA(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = XML_CDATA;
-
- match("= '\u0003' && cached_LA2 <= '\u7ffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\u7ffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\u7ffe')))&&( LA(2)!=']'))
- {
- match(']');
- }
- else if ((cached_LA1=='\n'||cached_LA1=='\r')) {
- mNL(false);
- }
- else if ((tokenSet_9_.member(cached_LA1))) {
- {
- match(tokenSet_9_);
- }
- }
- else
- {
- goto _loop307_breakloop;
- }
-
- }
-_loop307_breakloop: ;
- } // ( ... )*
- match("]]>");
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mXML_BINDING(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = XML_BINDING;
-
- match('{');
- mXML_AS3_EXPRESSION(false);
- match('}');
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mXML_AS3_EXPRESSION(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = XML_AS3_EXPRESSION;
-
- {
- { // ( ... )*
- for (;;)
- {
- if ((tokenSet_10_.member(cached_LA1)))
- {
- {
- match(tokenSet_10_);
- }
- }
- else
- {
- goto _loop296_breakloop;
- }
-
- }
-_loop296_breakloop: ;
- } // ( ... )*
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mNL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = NL;
-
- {
- if ((cached_LA1=='\r') && (cached_LA2=='\n') && (true) && (true))
- {
- match('\r');
- match('\n');
- }
- else if ((cached_LA1=='\r') && (true) && (true) && (true)) {
- match('\r');
- }
- else if ((cached_LA1=='\n')) {
- match('\n');
- }
- else
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
-
- }
- if (0==inputState.guessing)
- {
- newline(); _ttype = Token.SKIP;
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mNUMBER(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = NUMBER;
- Token t=null;
-
- if ((cached_LA1=='.') && (cached_LA2=='.') && (LA(3)=='.'))
- {
- match("...");
- if (0==inputState.guessing)
- {
- _ttype = REST;
- }
- }
- else if ((cached_LA1=='.') && (cached_LA2=='.') && (true)) {
- match("..");
- if (0==inputState.guessing)
- {
- _ttype = E4X_DESC;
- }
- }
- else if ((cached_LA1=='.') && (true)) {
- match('.');
- if (0==inputState.guessing)
- {
- _ttype = DOT;
- }
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
- {
- { // ( ... )+
- int _cnt311=0;
- for (;;)
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
- {
- matchRange('0','9');
- }
- else
- {
- if (_cnt311 >= 1) { goto _loop311_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
- }
-
- _cnt311++;
- }
-_loop311_breakloop: ;
- } // ( ... )+
- {
- if ((cached_LA1=='E'||cached_LA1=='e'))
- {
- mEXPONENT(false);
- }
- else {
- }
-
- }
- if (0==inputState.guessing)
- {
- _ttype = NUMBER;
- }
- }
- else {
- }
-
- }
- }
- else if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) {
- {
- switch ( cached_LA1 )
- {
- case '0':
- {
- match('0');
- {
- if ((cached_LA1=='X'||cached_LA1=='x'))
- {
- {
- switch ( cached_LA1 )
- {
- case 'X':
- {
- match('X');
- break;
- }
- case 'x':
- {
- match('x');
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- }
- { // ( ... )+
- int _cnt317=0;
- for (;;)
- {
- if ((tokenSet_11_.member(cached_LA1)))
- {
- mHEX_DIGIT(false);
- }
- else
- {
- if (_cnt317 >= 1) { goto _loop317_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
- }
-
- _cnt317++;
- }
-_loop317_breakloop: ;
- } // ( ... )+
- }
- else if (((cached_LA1 >= '0' && cached_LA1 <= '7')) && (true) && (true) && (true)) {
- { // ( ... )+
- int _cnt333=0;
- for (;;)
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '7')))
- {
- matchRange('0','7');
- }
- else
- {
- if (_cnt333 >= 1) { goto _loop333_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
- }
-
- _cnt333++;
- }
-_loop333_breakloop: ;
- } // ( ... )+
- }
- else {
- bool synPredMatched325 = false;
- if (( true ))
- {
- int _m325 = mark();
- synPredMatched325 = true;
- inputState.guessing++;
- try {
- {
- { // ( ... )*
- for (;;)
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
- {
- matchRange('0','9');
- }
- else
- {
- goto _loop320_breakloop;
- }
-
- }
-_loop320_breakloop: ;
- } // ( ... )*
- {
- if ((cached_LA1=='.'))
- {
- match('.');
- { // ( ... )+
- int _cnt323=0;
- for (;;)
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
- {
- matchRange('0','9');
- }
- else
- {
- if (_cnt323 >= 1) { goto _loop323_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
- }
-
- _cnt323++;
- }
-_loop323_breakloop: ;
- } // ( ... )+
- }
- else {
- }
-
- }
- {
- if ((cached_LA1=='E'||cached_LA1=='e'))
- {
- mEXPONENT(false);
- }
- else {
- }
-
- }
- }
- }
- catch (RecognitionException)
- {
- synPredMatched325 = false;
- }
- rewind(_m325);
- inputState.guessing--;
- }
- if ( synPredMatched325 )
- {
- { // ( ... )*
- for (;;)
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
- {
- matchRange('0','9');
- }
- else
- {
- goto _loop327_breakloop;
- }
-
- }
-_loop327_breakloop: ;
- } // ( ... )*
- {
- if ((cached_LA1=='.'))
- {
- match('.');
- { // ( ... )+
- int _cnt330=0;
- for (;;)
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
- {
- matchRange('0','9');
- }
- else
- {
- if (_cnt330 >= 1) { goto _loop330_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
- }
-
- _cnt330++;
- }
-_loop330_breakloop: ;
- } // ( ... )+
- }
- else {
- }
-
- }
- {
- if ((cached_LA1=='E'||cached_LA1=='e'))
- {
- mEXPONENT(false);
- }
- else {
- }
-
- }
- }
- else {
- }
- }
- }
- break;
- }
- case '1': case '2': case '3': case '4':
- case '5': case '6': case '7': case '8':
- case '9':
- {
- {
- matchRange('1','9');
- }
- { // ( ... )*
- for (;;)
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
- {
- matchRange('0','9');
- }
- else
- {
- goto _loop336_breakloop;
- }
-
- }
-_loop336_breakloop: ;
- } // ( ... )*
- if (0==inputState.guessing)
- {
- _ttype = NUMBER;
- }
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- }
- }
- else
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
-
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mEXPONENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = EXPONENT;
-
- {
- switch ( cached_LA1 )
- {
- case 'e':
- {
- match('e');
- break;
- }
- case 'E':
- {
- match('E');
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- }
- {
- switch ( cached_LA1 )
- {
- case '+':
- {
- match('+');
- break;
- }
- case '-':
- {
- match('-');
- break;
- }
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- case '8': case '9':
- {
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- }
- { // ( ... )+
- int _cnt372=0;
- for (;;)
- {
- if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
- {
- matchRange('0','9');
- }
- else
- {
- if (_cnt372 >= 1) { goto _loop372_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
- }
-
- _cnt372++;
- }
-_loop372_breakloop: ;
- } // ( ... )+
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mHEX_DIGIT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = HEX_DIGIT;
-
- {
- switch ( cached_LA1 )
- {
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- case '8': case '9':
- {
- matchRange('0','9');
- break;
- }
- case 'A': case 'B': case 'C': case 'D':
- case 'E': case 'F':
- {
- matchRange('A','F');
- break;
- }
- case 'a': case 'b': case 'c': case 'd':
- case 'e': case 'f':
- {
- matchRange('a','f');
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mREGEX_LITERAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = REGEX_LITERAL;
-
- match('/');
- mREGEX_BODY(false);
- match('/');
- { // ( ... )*
- for (;;)
- {
- switch ( cached_LA1 )
- {
- case 'a': case 'b': case 'c': case 'd':
- case 'e': case 'f': case 'g': case 'h':
- case 'i': case 'j': case 'k': case 'l':
- case 'm': case 'n': case 'o': case 'p':
- case 'q': case 'r': case 's': case 't':
- case 'u': case 'v': case 'w': case 'x':
- case 'y': case 'z':
- {
- matchRange('a','z');
- break;
- }
- case 'A': case 'B': case 'C': case 'D':
- case 'E': case 'F': case 'G': case 'H':
- case 'I': case 'J': case 'K': case 'L':
- case 'M': case 'N': case 'O': case 'P':
- case 'Q': case 'R': case 'S': case 'T':
- case 'U': case 'V': case 'W': case 'X':
- case 'Y': case 'Z':
- {
- matchRange('A','Z');
- break;
- }
- case '_':
- {
- match('_');
- break;
- }
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- case '8': case '9':
- {
- matchRange('0','9');
- break;
- }
- case '$':
- {
- match('$');
- break;
- }
- default:
- {
- goto _loop339_breakloop;
- }
- }
- }
-_loop339_breakloop: ;
- } // ( ... )*
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- protected void mREGEX_BODY(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = REGEX_BODY;
-
- {
- if ((tokenSet_12_.member(cached_LA1)))
- {
- {
- {
- match(tokenSet_12_);
- }
- }
- }
- else if ((cached_LA1=='\\')) {
- match('\\');
- {
- {
- match(tokenSet_1_);
- }
- }
- }
- else
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
-
- }
- { // ( ... )*
- for (;;)
- {
- if ((tokenSet_13_.member(cached_LA1)))
- {
- {
- {
- match(tokenSet_13_);
- }
- }
- }
- else if ((cached_LA1=='\\')) {
- match('\\');
- {
- {
- match(tokenSet_1_);
- }
- }
- }
- else
- {
- goto _loop351_breakloop;
- }
-
- }
-_loop351_breakloop: ;
- } // ( ... )*
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mBOM(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = BOM;
-
- switch ( cached_LA1 )
- {
- case '\u00ef':
- {
- match('\u00EF');
- break;
- }
- case '\u00bb':
- {
- match('\u00BB');
- break;
- }
- case '\u00bf':
- {
- match('\u00BF');
- if (0==inputState.guessing)
- {
- _ttype = Token.SKIP;
- }
- break;
- }
- default:
- {
- throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
- }
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mSL_COMMENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = SL_COMMENT;
-
- match("//");
- { // ( ... )*
- for (;;)
- {
- if ((tokenSet_1_.member(cached_LA1)))
- {
- {
- match(tokenSet_1_);
- }
- }
- else
- {
- goto _loop361_breakloop;
- }
-
- }
-_loop361_breakloop: ;
- } // ( ... )*
- {
- switch ( cached_LA1 )
- {
- case '\n':
- {
- match('\n');
- break;
- }
- case '\r':
- {
- match('\r');
- {
- if ((cached_LA1=='\n'))
- {
- match('\n');
- }
- else {
- }
-
- }
- break;
- }
- default:
- {
- }
- break; }
- }
- if (0==inputState.guessing)
- {
- _ttype = Token.SKIP; newline();
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
- public void mML_COMMENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
-{
- int _ttype; IToken _token=null; int _begin=text.Length;
- _ttype = ML_COMMENT;
-
- match("/*");
- { // ( ... )*
- for (;;)
- {
- if (((cached_LA1=='*') && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\u7ffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\u7ffe')))&&( LA(2)!='/' ))
- {
- match('*');
- }
- else if ((cached_LA1=='\n'||cached_LA1=='\r')) {
- mNL(false);
- }
- else if ((tokenSet_14_.member(cached_LA1))) {
- {
- match(tokenSet_14_);
- }
- }
- else
- {
- goto _loop367_breakloop;
- }
-
- }
-_loop367_breakloop: ;
- } // ( ... )*
- match("*/");
- if (0==inputState.guessing)
- {
- _ttype = Token.SKIP;
- }
- if (_createToken && (null == _token) && (_ttype != Token.SKIP))
- {
- _token = makeToken(_ttype);
- _token.setText(text.ToString(_begin, text.Length-_begin));
- }
- returnToken_ = _token;
- }
-
-
- private static long[] mk_tokenSet_0_()
- {
- long[] data = new long[1024];
- data[0]=-145135534875656L;
- for (int i = 1; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_0_ = new BitSet(mk_tokenSet_0_());
- private static long[] mk_tokenSet_1_()
- {
- long[] data = new long[1024];
- data[0]=-9224L;
- for (int i = 1; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_1_ = new BitSet(mk_tokenSet_1_());
- private static long[] mk_tokenSet_2_()
- {
- long[] data = new long[513];
- data[0]=68719476736L;
- data[1]=576460745995190270L;
- for (int i = 2; i<=512; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_2_ = new BitSet(mk_tokenSet_2_());
- private static long[] mk_tokenSet_3_()
- {
- long[] data = new long[1024];
- data[0]=-17179878408L;
- data[1]=-268435457L;
- for (int i = 2; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_3_ = new BitSet(mk_tokenSet_3_());
- private static long[] mk_tokenSet_4_()
- {
- long[] data = new long[1024];
- data[0]=-549755823112L;
- data[1]=-268435457L;
- for (int i = 2; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_4_ = new BitSet(mk_tokenSet_4_());
- private static long[] mk_tokenSet_5_()
- {
- long[] data = new long[1024];
- data[0]=-8L;
- data[1]=-576460752303423489L;
- for (int i = 2; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_5_ = new BitSet(mk_tokenSet_5_());
- private static long[] mk_tokenSet_6_()
- {
- long[] data = new long[1024];
- data[0]=-1152921504606846984L;
- data[1]=-576460752303423489L;
- for (int i = 2; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_6_ = new BitSet(mk_tokenSet_6_());
- private static long[] mk_tokenSet_7_()
- {
- long[] data = new long[1024];
- data[0]=-1153062242095211528L;
- data[1]=-576460752303423489L;
- for (int i = 2; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_7_ = new BitSet(mk_tokenSet_7_());
- private static long[] mk_tokenSet_8_()
- {
- long[] data = new long[1024];
- data[0]=-35184372098056L;
- for (int i = 1; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_8_ = new BitSet(mk_tokenSet_8_());
- private static long[] mk_tokenSet_9_()
- {
- long[] data = new long[1024];
- data[0]=-9224L;
- data[1]=-536870913L;
- for (int i = 2; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_9_ = new BitSet(mk_tokenSet_9_());
- private static long[] mk_tokenSet_10_()
- {
- long[] data = new long[1024];
- data[0]=-8L;
- data[1]=-2882303761517117441L;
- for (int i = 2; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_10_ = new BitSet(mk_tokenSet_10_());
- private static long[] mk_tokenSet_11_()
- {
- long[] data = new long[513];
- data[0]=287948901175001088L;
- data[1]=541165879422L;
- for (int i = 2; i<=512; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_11_ = new BitSet(mk_tokenSet_11_());
- private static long[] mk_tokenSet_12_()
- {
- long[] data = new long[1024];
- data[0]=-145135534875656L;
- data[1]=-268435457L;
- for (int i = 2; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_12_ = new BitSet(mk_tokenSet_12_());
- private static long[] mk_tokenSet_13_()
- {
- long[] data = new long[1024];
- data[0]=-140737488364552L;
- data[1]=-268435457L;
- for (int i = 2; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_13_ = new BitSet(mk_tokenSet_13_());
- private static long[] mk_tokenSet_14_()
- {
- long[] data = new long[1024];
- data[0]=-4398046520328L;
- for (int i = 1; i<=510; i++) { data[i]=-1L; }
- data[511]=9223372036854775807L;
- for (int i = 512; i<=1023; i++) { data[i]=0L; }
- return data;
- }
- public static readonly BitSet tokenSet_14_ = new BitSet(mk_tokenSet_14_());
-
+ for (;;)
+ {
+ IToken _token = null;
+ int _ttype = Token.INVALID_TYPE;
+ resetText();
+ try // for char stream error handling
+ {
+ try // for lexical error handling
+ {
+ switch ( cached_LA1 )
+ {
+ case '?':
+ {
+ mQUESTION(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '(':
+ {
+ mLPAREN(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case ')':
+ {
+ mRPAREN(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '[':
+ {
+ mLBRACK(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case ']':
+ {
+ mRBRACK(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '{':
+ {
+ mLCURLY(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '}':
+ {
+ mRCURLY(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case ',':
+ {
+ mCOMMA(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '~':
+ {
+ mBNOT(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '@':
+ {
+ mE4X_ATTRI(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case ';':
+ {
+ mSEMI(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '$': case 'A': case 'B': case 'C':
+ case 'D': case 'E': case 'F': case 'G':
+ case 'H': case 'I': case 'J': case 'K':
+ case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S':
+ case 'T': case 'U': case 'V': case 'W':
+ case 'X': case 'Y': case 'Z': case '_':
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ {
+ mIDENT(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '"': case '\'':
+ {
+ mSTRING_LITERAL(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '\t': case '\n': case '\u000c': case '\r':
+ case ' ':
+ {
+ mWS(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '.': case '0': case '1': case '2':
+ case '3': case '4': case '5': case '6':
+ case '7': case '8': case '9':
+ {
+ mNUMBER(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ case '\u00bb': case '\u00bf': case '\u00ef':
+ {
+ mBOM(true);
+ theRetToken = returnToken_;
+ break;
+ }
+ default:
+ if ((cached_LA1=='>') && (cached_LA2=='>') && (LA(3)=='>') && (LA(4)=='='))
+ {
+ mBSR_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='=') && (cached_LA2=='=') && (LA(3)=='=')) {
+ mSTRICT_EQUAL(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='!') && (cached_LA2=='=') && (LA(3)=='=')) {
+ mSTRICT_NOT_EQUAL(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='>') && (cached_LA2=='>') && (LA(3)=='=')) {
+ mSR_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='>') && (cached_LA2=='>') && (LA(3)=='>') && (true)) {
+ mBSR(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='<') && (cached_LA2=='<') && (LA(3)=='=')) {
+ mSL_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='&') && (cached_LA2=='&') && (LA(3)=='=')) {
+ mLAND_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='|') && (cached_LA2=='|') && (LA(3)=='=')) {
+ mLOR_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='/') && (tokenSet_0_.member(cached_LA2)) && (tokenSet_1_.member(LA(3)))) {
+ mREGEX_LITERAL(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1==':') && (cached_LA2==':')) {
+ mDBL_COLON(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='=') && (cached_LA2=='=') && (true)) {
+ mEQUAL(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='!') && (cached_LA2=='=') && (true)) {
+ mNOT_EQUAL(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='/') && (cached_LA2=='=') && (true)) {
+ mDIV_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='+') && (cached_LA2=='=')) {
+ mPLUS_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='+') && (cached_LA2=='+')) {
+ mINC(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='-') && (cached_LA2=='=')) {
+ mMINUS_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='-') && (cached_LA2=='-')) {
+ mDEC(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='*') && (cached_LA2=='=')) {
+ mSTAR_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='%') && (cached_LA2=='=')) {
+ mMOD_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='>') && (cached_LA2=='>') && (true)) {
+ mSR(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='>') && (cached_LA2=='=')) {
+ mGE(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='<') && (cached_LA2=='<') && (true)) {
+ mSL(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='<') && (cached_LA2=='=')) {
+ mLE(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='^') && (cached_LA2=='=')) {
+ mBXOR_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='|') && (cached_LA2=='=')) {
+ mBOR_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='|') && (cached_LA2=='|') && (true)) {
+ mLOR(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='&') && (cached_LA2=='=')) {
+ mBAND_ASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='&') && (cached_LA2=='&') && (true)) {
+ mLAND(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='<') && (tokenSet_2_.member(cached_LA2))) {
+ mXML_LITERAL(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='/') && (cached_LA2=='/')) {
+ mSL_COMMENT(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='/') && (cached_LA2=='*')) {
+ mML_COMMENT(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1==':') && (true)) {
+ mCOLON(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='=') && (true)) {
+ mASSIGN(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='!') && (true)) {
+ mLNOT(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='/') && (true)) {
+ mDIV(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='+') && (true)) {
+ mPLUS(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='-') && (true)) {
+ mMINUS(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='*') && (true)) {
+ mSTAR(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='%') && (true)) {
+ mMOD(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='>') && (true)) {
+ mGT(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='<') && (true)) {
+ mLWT(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='^') && (true)) {
+ mBXOR(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='|') && (true)) {
+ mBOR(true);
+ theRetToken = returnToken_;
+ }
+ else if ((cached_LA1=='&') && (true)) {
+ mBAND(true);
+ theRetToken = returnToken_;
+ }
+ else
+ {
+ if (cached_LA1==EOF_CHAR) { uponEOF(); returnToken_ = makeToken(Token.EOF_TYPE); }
+ else {throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());}
+ }
+ break; }
+ if ( null==returnToken_ ) goto tryAgain; // found SKIP token
+ _ttype = returnToken_.Type;
+ returnToken_.Type = _ttype;
+ return returnToken_;
+ }
+ catch (RecognitionException e) {
+ throw new TokenStreamRecognitionException(e);
+ }
+ }
+ catch (CharStreamException cse) {
+ if ( cse is CharStreamIOException ) {
+ throw new TokenStreamIOException(((CharStreamIOException)cse).io);
+ }
+ else {
+ throw new TokenStreamException(cse.Message);
+ }
+ }
+ }
+ }
+
+ public void mQUESTION(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = QUESTION;
+
+ match('?');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mLPAREN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = LPAREN;
+
+ match('(');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mRPAREN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = RPAREN;
+
+ match(')');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mLBRACK(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = LBRACK;
+
+ match('[');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mRBRACK(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = RBRACK;
+
+ match(']');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mLCURLY(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = LCURLY;
+
+ match('{');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mRCURLY(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = RCURLY;
+
+ match('}');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mCOLON(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = COLON;
+
+ match(':');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mDBL_COLON(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = DBL_COLON;
+
+ match("::");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mCOMMA(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = COMMA;
+
+ match(',');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = ASSIGN;
+
+ match('=');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mEQUAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = EQUAL;
+
+ match("==");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSTRICT_EQUAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = STRICT_EQUAL;
+
+ match("===");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mLNOT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = LNOT;
+
+ match('!');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mBNOT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = BNOT;
+
+ match('~');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mNOT_EQUAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = NOT_EQUAL;
+
+ match("!=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSTRICT_NOT_EQUAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = STRICT_NOT_EQUAL;
+
+ match("!==");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mDIV(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = DIV;
+
+ match('/');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mDIV_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = DIV_ASSIGN;
+
+ match("/=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mPLUS(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = PLUS;
+
+ match('+');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mPLUS_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = PLUS_ASSIGN;
+
+ match("+=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mINC(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = INC;
+
+ match("++");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mMINUS(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = MINUS;
+
+ match('-');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mMINUS_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = MINUS_ASSIGN;
+
+ match("-=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mDEC(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = DEC;
+
+ match("--");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSTAR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = STAR;
+
+ match('*');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSTAR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = STAR_ASSIGN;
+
+ match("*=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mMOD(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = MOD;
+
+ match('%');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mMOD_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = MOD_ASSIGN;
+
+ match("%=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = SR;
+
+ match(">>");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = SR_ASSIGN;
+
+ match(">>=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mBSR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = BSR;
+
+ match(">>>");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mBSR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = BSR_ASSIGN;
+
+ match(">>>=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mGE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = GE;
+
+ match(">=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mGT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = GT;
+
+ match('>');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = SL;
+
+ match("<<");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSL_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = SL_ASSIGN;
+
+ match("<<=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mLE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = LE;
+
+ match("<=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mLWT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = LWT;
+
+ match('<');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mBXOR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = BXOR;
+
+ match('^');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mBXOR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = BXOR_ASSIGN;
+
+ match("^=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mBOR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = BOR;
+
+ match('|');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mBOR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = BOR_ASSIGN;
+
+ match("|=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mLOR(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = LOR;
+
+ match("||");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mBAND(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = BAND;
+
+ match('&');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mBAND_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = BAND_ASSIGN;
+
+ match("&=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mLAND(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = LAND;
+
+ match("&&");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mLAND_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = LAND_ASSIGN;
+
+ match("&&=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mLOR_ASSIGN(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = LOR_ASSIGN;
+
+ match("||=");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mE4X_ATTRI(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = E4X_ATTRI;
+
+ match('@');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSEMI(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = SEMI;
+
+ match(';');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ private void mDOT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = DOT;
+
+ match('.');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ private void mE4X_DESC(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = E4X_DESC;
+
+ match("..");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ private void mREST(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = REST;
+
+ match("...");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mIDENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = IDENT;
+
+ {
+ switch ( cached_LA1 )
+ {
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z':
+ {
+ matchRange('A','Z');
+ break;
+ }
+ case '_':
+ {
+ match('_');
+ break;
+ }
+ case '$':
+ {
+ match('$');
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if (((cached_LA1 >= 'a' && cached_LA1 <= 'z')) && (true) && (true) && (true))
+ {
+ matchRange('a','z');
+ }
+ else if (((cached_LA1 >= 'A' && cached_LA1 <= 'Z')) && (true) && (true) && (true)) {
+ matchRange('A','Z');
+ }
+ else if ((cached_LA1=='_') && (true) && (true) && (true)) {
+ match('_');
+ }
+ else if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) {
+ matchRange('0','9');
+ }
+ else if ((cached_LA1=='$') && (true) && (true) && (true)) {
+ match('$');
+ }
+ else
+ {
+ goto _loop271_breakloop;
+ }
+
+ }
+_loop271_breakloop: ;
+ } // ( ... )*
+ _ttype = testLiteralsTable(_ttype);
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSTRING_LITERAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = STRING_LITERAL;
+
+ switch ( cached_LA1 )
+ {
+ case '"':
+ {
+ match('"');
+ { // ( ... )*
+ for (;;)
+ {
+ if ((cached_LA1=='\\'))
+ {
+ mESC(false);
+ }
+ else if ((tokenSet_3_.member(cached_LA1))) {
+ {
+ match(tokenSet_3_);
+ }
+ }
+ else
+ {
+ goto _loop275_breakloop;
+ }
+
+ }
+_loop275_breakloop: ;
+ } // ( ... )*
+ match('"');
+ break;
+ }
+ case '\'':
+ {
+ match('\'');
+ { // ( ... )*
+ for (;;)
+ {
+ if ((cached_LA1=='\\'))
+ {
+ mESC(false);
+ }
+ else if ((tokenSet_4_.member(cached_LA1))) {
+ {
+ match(tokenSet_4_);
+ }
+ }
+ else
+ {
+ goto _loop278_breakloop;
+ }
+
+ }
+_loop278_breakloop: ;
+ } // ( ... )*
+ match('\'');
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mESC(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = ESC;
+
+ match('\\');
+ {
+ switch ( cached_LA1 )
+ {
+ case 'n':
+ {
+ match('n');
+ break;
+ }
+ case 'r':
+ {
+ match('r');
+ break;
+ }
+ case 't':
+ {
+ match('t');
+ break;
+ }
+ case 'b':
+ {
+ match('b');
+ break;
+ }
+ case 'f':
+ {
+ match('f');
+ break;
+ }
+ case '"':
+ {
+ match('"');
+ break;
+ }
+ case '\'':
+ {
+ match('\'');
+ break;
+ }
+ case '\\':
+ {
+ match('\\');
+ break;
+ }
+ case 'u':
+ {
+ { // ( ... )+
+ int _cnt378=0;
+ for (;;)
+ {
+ if ((cached_LA1=='u'))
+ {
+ match('u');
+ }
+ else
+ {
+ if (_cnt378 >= 1) { goto _loop378_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
+ }
+
+ _cnt378++;
+ }
+_loop378_breakloop: ;
+ } // ( ... )+
+ mHEX_DIGIT(false);
+ mHEX_DIGIT(false);
+ mHEX_DIGIT(false);
+ mHEX_DIGIT(false);
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ {
+ matchRange('0','3');
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '7')) && (tokenSet_1_.member(cached_LA2)) && (true) && (true))
+ {
+ matchRange('0','7');
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '7')) && (tokenSet_1_.member(cached_LA2)) && (true) && (true))
+ {
+ matchRange('0','7');
+ }
+ else if ((tokenSet_1_.member(cached_LA1)) && (true) && (true) && (true)) {
+ }
+ else
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+
+ }
+ }
+ else if ((tokenSet_1_.member(cached_LA1)) && (true) && (true) && (true)) {
+ }
+ else
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+
+ }
+ break;
+ }
+ case '4': case '5': case '6': case '7':
+ {
+ matchRange('4','7');
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '7')) && (tokenSet_1_.member(cached_LA2)) && (true) && (true))
+ {
+ matchRange('0','7');
+ }
+ else if ((tokenSet_1_.member(cached_LA1)) && (true) && (true) && (true)) {
+ }
+ else
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mXML_LITERAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = XML_LITERAL;
+
+ match('<');
+ mIDENT(false);
+ { // ( ... )*
+ for (;;)
+ {
+ switch ( cached_LA1 )
+ {
+ case '\t': case '\n': case '\u000c': case '\r':
+ case ' ':
+ {
+ mWS(false);
+ break;
+ }
+ case '$': case 'A': case 'B': case 'C':
+ case 'D': case 'E': case 'F': case 'G':
+ case 'H': case 'I': case 'J': case 'K':
+ case 'L': case 'M': case 'N': case 'O':
+ case 'P': case 'Q': case 'R': case 'S':
+ case 'T': case 'U': case 'V': case 'W':
+ case 'X': case 'Y': case 'Z': case '_':
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ {
+ mXML_ATTRIBUTE(false);
+ break;
+ }
+ default:
+ {
+ goto _loop281_breakloop;
+ }
+ }
+ }
+_loop281_breakloop: ;
+ } // ( ... )*
+ {
+ switch ( cached_LA1 )
+ {
+ case '>':
+ {
+ match('>');
+ { // ( ... )*
+ for (;;)
+ {
+ if ((cached_LA1=='\t'||cached_LA1=='\n'||cached_LA1=='\u000c'||cached_LA1=='\r'||cached_LA1==' ') && (tokenSet_5_.member(cached_LA2)) && (tokenSet_5_.member(LA(3))) && (tokenSet_5_.member(LA(4))))
+ {
+ mWS(false);
+ }
+ else if ((tokenSet_6_.member(cached_LA1)) && (tokenSet_5_.member(cached_LA2)) && (tokenSet_5_.member(LA(3))) && (tokenSet_5_.member(LA(4)))) {
+ mXML_TEXTNODE(false);
+ }
+ else if ((cached_LA1=='<') && (cached_LA2=='!') && (LA(3)=='-')) {
+ mXML_COMMENT(false);
+ }
+ else if ((cached_LA1=='<') && (cached_LA2=='!') && (LA(3)=='[')) {
+ mXML_CDATA(false);
+ }
+ else if ((cached_LA1=='<') && (tokenSet_2_.member(cached_LA2))) {
+ mXML_LITERAL(false);
+ }
+ else
+ {
+ goto _loop284_breakloop;
+ }
+
+ }
+_loop284_breakloop: ;
+ } // ( ... )*
+ match("");
+ mIDENT(false);
+ match('>');
+ break;
+ }
+ case '/':
+ {
+ match("/>");
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mWS(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = WS;
+
+ { // ( ... )+
+ int _cnt354=0;
+ for (;;)
+ {
+ if ((cached_LA1==' ') && (true) && (true) && (true))
+ {
+ match(' ');
+ }
+ else if ((cached_LA1=='\t') && (true) && (true) && (true)) {
+ match('\t');
+ }
+ else if ((cached_LA1=='\u000c') && (true) && (true) && (true)) {
+ match('\f');
+ }
+ else if ((cached_LA1=='\n'||cached_LA1=='\r') && (true) && (true) && (true)) {
+ mNL(false);
+ }
+ else
+ {
+ if (_cnt354 >= 1) { goto _loop354_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
+ }
+
+ _cnt354++;
+ }
+_loop354_breakloop: ;
+ } // ( ... )+
+ if (0==inputState.guessing)
+ {
+ _ttype = Token.SKIP;
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mXML_ATTRIBUTE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = XML_ATTRIBUTE;
+
+ mIDENT(false);
+ { // ( ... )*
+ for (;;)
+ {
+ if ((cached_LA1=='\t'||cached_LA1=='\n'||cached_LA1=='\u000c'||cached_LA1=='\r'||cached_LA1==' '))
+ {
+ mWS(false);
+ }
+ else
+ {
+ goto _loop287_breakloop;
+ }
+
+ }
+_loop287_breakloop: ;
+ } // ( ... )*
+ mASSIGN(false);
+ { // ( ... )*
+ for (;;)
+ {
+ if ((cached_LA1=='\t'||cached_LA1=='\n'||cached_LA1=='\u000c'||cached_LA1=='\r'||cached_LA1==' '))
+ {
+ mWS(false);
+ }
+ else
+ {
+ goto _loop289_breakloop;
+ }
+
+ }
+_loop289_breakloop: ;
+ } // ( ... )*
+ {
+ switch ( cached_LA1 )
+ {
+ case '"': case '\'':
+ {
+ mSTRING_LITERAL(false);
+ break;
+ }
+ case '{':
+ {
+ mXML_BINDING(false);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mXML_TEXTNODE(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = XML_TEXTNODE;
+
+ {
+ if ((cached_LA1=='\n'||cached_LA1=='\r'))
+ {
+ mNL(false);
+ }
+ else if (((cached_LA1=='/'))&&( LA(2)!='>' )) {
+ match('/');
+ }
+ else if ((tokenSet_7_.member(cached_LA1))) {
+ {
+ match(tokenSet_7_);
+ }
+ }
+ else
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mXML_COMMENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = XML_COMMENT;
+
+ match("");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mXML_CDATA(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = XML_CDATA;
+
+ match("= '\u0003' && cached_LA2 <= '\u7ffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\u7ffe')) && ((LA(4) >= '\u0003' && LA(4) <= '\u7ffe')))&&( LA(2)!=']'))
+ {
+ match(']');
+ }
+ else if ((cached_LA1=='\n'||cached_LA1=='\r')) {
+ mNL(false);
+ }
+ else if ((tokenSet_9_.member(cached_LA1))) {
+ {
+ match(tokenSet_9_);
+ }
+ }
+ else
+ {
+ goto _loop307_breakloop;
+ }
+
+ }
+_loop307_breakloop: ;
+ } // ( ... )*
+ match("]]>");
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mXML_BINDING(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = XML_BINDING;
+
+ match('{');
+ mXML_AS3_EXPRESSION(false);
+ match('}');
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mXML_AS3_EXPRESSION(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = XML_AS3_EXPRESSION;
+
+ {
+ { // ( ... )*
+ for (;;)
+ {
+ if ((tokenSet_10_.member(cached_LA1)))
+ {
+ {
+ match(tokenSet_10_);
+ }
+ }
+ else
+ {
+ goto _loop296_breakloop;
+ }
+
+ }
+_loop296_breakloop: ;
+ } // ( ... )*
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mNL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = NL;
+
+ {
+ if ((cached_LA1=='\r') && (cached_LA2=='\n') && (true) && (true))
+ {
+ match('\r');
+ match('\n');
+ }
+ else if ((cached_LA1=='\r') && (true) && (true) && (true)) {
+ match('\r');
+ }
+ else if ((cached_LA1=='\n')) {
+ match('\n');
+ }
+ else
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+
+ }
+ if (0==inputState.guessing)
+ {
+ newline(); _ttype = Token.SKIP;
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mNUMBER(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = NUMBER;
+ Token t=null;
+
+ if ((cached_LA1=='.') && (cached_LA2=='.') && (LA(3)=='.'))
+ {
+ match("...");
+ if (0==inputState.guessing)
+ {
+ _ttype = REST;
+ }
+ }
+ else if ((cached_LA1=='.') && (cached_LA2=='.') && (true)) {
+ match("..");
+ if (0==inputState.guessing)
+ {
+ _ttype = E4X_DESC;
+ }
+ }
+ else if ((cached_LA1=='.') && (true)) {
+ match('.');
+ if (0==inputState.guessing)
+ {
+ _ttype = DOT;
+ }
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
+ {
+ { // ( ... )+
+ int _cnt311=0;
+ for (;;)
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
+ {
+ matchRange('0','9');
+ }
+ else
+ {
+ if (_cnt311 >= 1) { goto _loop311_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
+ }
+
+ _cnt311++;
+ }
+_loop311_breakloop: ;
+ } // ( ... )+
+ {
+ if ((cached_LA1=='E'||cached_LA1=='e'))
+ {
+ mEXPONENT(false);
+ }
+ else {
+ }
+
+ }
+ if (0==inputState.guessing)
+ {
+ _ttype = NUMBER;
+ }
+ }
+ else {
+ }
+
+ }
+ }
+ else if (((cached_LA1 >= '0' && cached_LA1 <= '9'))) {
+ {
+ switch ( cached_LA1 )
+ {
+ case '0':
+ {
+ match('0');
+ {
+ if ((cached_LA1=='X'||cached_LA1=='x'))
+ {
+ {
+ switch ( cached_LA1 )
+ {
+ case 'X':
+ {
+ match('X');
+ break;
+ }
+ case 'x':
+ {
+ match('x');
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ { // ( ... )+
+ int _cnt317=0;
+ for (;;)
+ {
+ if ((tokenSet_11_.member(cached_LA1)))
+ {
+ mHEX_DIGIT(false);
+ }
+ else
+ {
+ if (_cnt317 >= 1) { goto _loop317_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
+ }
+
+ _cnt317++;
+ }
+_loop317_breakloop: ;
+ } // ( ... )+
+ }
+ else if (((cached_LA1 >= '0' && cached_LA1 <= '7')) && (true) && (true) && (true)) {
+ { // ( ... )+
+ int _cnt333=0;
+ for (;;)
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '7')))
+ {
+ matchRange('0','7');
+ }
+ else
+ {
+ if (_cnt333 >= 1) { goto _loop333_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
+ }
+
+ _cnt333++;
+ }
+_loop333_breakloop: ;
+ } // ( ... )+
+ }
+ else {
+ bool synPredMatched325 = false;
+ if (( true ))
+ {
+ int _m325 = mark();
+ synPredMatched325 = true;
+ inputState.guessing++;
+ try {
+ {
+ { // ( ... )*
+ for (;;)
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
+ {
+ matchRange('0','9');
+ }
+ else
+ {
+ goto _loop320_breakloop;
+ }
+
+ }
+_loop320_breakloop: ;
+ } // ( ... )*
+ {
+ if ((cached_LA1=='.'))
+ {
+ match('.');
+ { // ( ... )+
+ int _cnt323=0;
+ for (;;)
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
+ {
+ matchRange('0','9');
+ }
+ else
+ {
+ if (_cnt323 >= 1) { goto _loop323_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
+ }
+
+ _cnt323++;
+ }
+_loop323_breakloop: ;
+ } // ( ... )+
+ }
+ else {
+ }
+
+ }
+ {
+ if ((cached_LA1=='E'||cached_LA1=='e'))
+ {
+ mEXPONENT(false);
+ }
+ else {
+ }
+
+ }
+ }
+ }
+ catch (RecognitionException)
+ {
+ synPredMatched325 = false;
+ }
+ rewind(_m325);
+ inputState.guessing--;
+ }
+ if ( synPredMatched325 )
+ {
+ { // ( ... )*
+ for (;;)
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
+ {
+ matchRange('0','9');
+ }
+ else
+ {
+ goto _loop327_breakloop;
+ }
+
+ }
+_loop327_breakloop: ;
+ } // ( ... )*
+ {
+ if ((cached_LA1=='.'))
+ {
+ match('.');
+ { // ( ... )+
+ int _cnt330=0;
+ for (;;)
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
+ {
+ matchRange('0','9');
+ }
+ else
+ {
+ if (_cnt330 >= 1) { goto _loop330_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
+ }
+
+ _cnt330++;
+ }
+_loop330_breakloop: ;
+ } // ( ... )+
+ }
+ else {
+ }
+
+ }
+ {
+ if ((cached_LA1=='E'||cached_LA1=='e'))
+ {
+ mEXPONENT(false);
+ }
+ else {
+ }
+
+ }
+ }
+ else {
+ }
+ }
+ }
+ break;
+ }
+ case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8':
+ case '9':
+ {
+ {
+ matchRange('1','9');
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
+ {
+ matchRange('0','9');
+ }
+ else
+ {
+ goto _loop336_breakloop;
+ }
+
+ }
+_loop336_breakloop: ;
+ } // ( ... )*
+ if (0==inputState.guessing)
+ {
+ _ttype = NUMBER;
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ }
+ else
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mEXPONENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = EXPONENT;
+
+ {
+ switch ( cached_LA1 )
+ {
+ case 'e':
+ {
+ match('e');
+ break;
+ }
+ case 'E':
+ {
+ match('E');
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ {
+ switch ( cached_LA1 )
+ {
+ case '+':
+ {
+ match('+');
+ break;
+ }
+ case '-':
+ {
+ match('-');
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9':
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ { // ( ... )+
+ int _cnt372=0;
+ for (;;)
+ {
+ if (((cached_LA1 >= '0' && cached_LA1 <= '9')))
+ {
+ matchRange('0','9');
+ }
+ else
+ {
+ if (_cnt372 >= 1) { goto _loop372_breakloop; } else { throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());; }
+ }
+
+ _cnt372++;
+ }
+_loop372_breakloop: ;
+ } // ( ... )+
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mHEX_DIGIT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = HEX_DIGIT;
+
+ {
+ switch ( cached_LA1 )
+ {
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9':
+ {
+ matchRange('0','9');
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F':
+ {
+ matchRange('A','F');
+ break;
+ }
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f':
+ {
+ matchRange('a','f');
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mREGEX_LITERAL(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = REGEX_LITERAL;
+
+ match('/');
+ mREGEX_BODY(false);
+ match('/');
+ { // ( ... )*
+ for (;;)
+ {
+ switch ( cached_LA1 )
+ {
+ case 'a': case 'b': case 'c': case 'd':
+ case 'e': case 'f': case 'g': case 'h':
+ case 'i': case 'j': case 'k': case 'l':
+ case 'm': case 'n': case 'o': case 'p':
+ case 'q': case 'r': case 's': case 't':
+ case 'u': case 'v': case 'w': case 'x':
+ case 'y': case 'z':
+ {
+ matchRange('a','z');
+ break;
+ }
+ case 'A': case 'B': case 'C': case 'D':
+ case 'E': case 'F': case 'G': case 'H':
+ case 'I': case 'J': case 'K': case 'L':
+ case 'M': case 'N': case 'O': case 'P':
+ case 'Q': case 'R': case 'S': case 'T':
+ case 'U': case 'V': case 'W': case 'X':
+ case 'Y': case 'Z':
+ {
+ matchRange('A','Z');
+ break;
+ }
+ case '_':
+ {
+ match('_');
+ break;
+ }
+ case '0': case '1': case '2': case '3':
+ case '4': case '5': case '6': case '7':
+ case '8': case '9':
+ {
+ matchRange('0','9');
+ break;
+ }
+ case '$':
+ {
+ match('$');
+ break;
+ }
+ default:
+ {
+ goto _loop339_breakloop;
+ }
+ }
+ }
+_loop339_breakloop: ;
+ } // ( ... )*
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ protected void mREGEX_BODY(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = REGEX_BODY;
+
+ {
+ if ((tokenSet_12_.member(cached_LA1)))
+ {
+ {
+ {
+ match(tokenSet_12_);
+ }
+ }
+ }
+ else if ((cached_LA1=='\\')) {
+ match('\\');
+ {
+ {
+ match(tokenSet_1_);
+ }
+ }
+ }
+ else
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((tokenSet_13_.member(cached_LA1)))
+ {
+ {
+ {
+ match(tokenSet_13_);
+ }
+ }
+ }
+ else if ((cached_LA1=='\\')) {
+ match('\\');
+ {
+ {
+ match(tokenSet_1_);
+ }
+ }
+ }
+ else
+ {
+ goto _loop351_breakloop;
+ }
+
+ }
+_loop351_breakloop: ;
+ } // ( ... )*
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mBOM(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = BOM;
+
+ switch ( cached_LA1 )
+ {
+ case '\u00ef':
+ {
+ match('\u00EF');
+ break;
+ }
+ case '\u00bb':
+ {
+ match('\u00BB');
+ break;
+ }
+ case '\u00bf':
+ {
+ match('\u00BF');
+ if (0==inputState.guessing)
+ {
+ _ttype = Token.SKIP;
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltForCharException(cached_LA1, getFilename(), getLine(), getColumn());
+ }
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mSL_COMMENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = SL_COMMENT;
+
+ match("//");
+ { // ( ... )*
+ for (;;)
+ {
+ if ((tokenSet_1_.member(cached_LA1)))
+ {
+ {
+ match(tokenSet_1_);
+ }
+ }
+ else
+ {
+ goto _loop361_breakloop;
+ }
+
+ }
+_loop361_breakloop: ;
+ } // ( ... )*
+ {
+ switch ( cached_LA1 )
+ {
+ case '\n':
+ {
+ match('\n');
+ break;
+ }
+ case '\r':
+ {
+ match('\r');
+ {
+ if ((cached_LA1=='\n'))
+ {
+ match('\n');
+ }
+ else {
+ }
+
+ }
+ break;
+ }
+ default:
+ {
+ }
+ break; }
+ }
+ if (0==inputState.guessing)
+ {
+ _ttype = Token.SKIP; newline();
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+ public void mML_COMMENT(bool _createToken) //throws RecognitionException, CharStreamException, TokenStreamException
+{
+ int _ttype; IToken _token=null; int _begin=text.Length;
+ _ttype = ML_COMMENT;
+
+ match("/*");
+ { // ( ... )*
+ for (;;)
+ {
+ if (((cached_LA1=='*') && ((cached_LA2 >= '\u0003' && cached_LA2 <= '\u7ffe')) && ((LA(3) >= '\u0003' && LA(3) <= '\u7ffe')))&&( LA(2)!='/' ))
+ {
+ match('*');
+ }
+ else if ((cached_LA1=='\n'||cached_LA1=='\r')) {
+ mNL(false);
+ }
+ else if ((tokenSet_14_.member(cached_LA1))) {
+ {
+ match(tokenSet_14_);
+ }
+ }
+ else
+ {
+ goto _loop367_breakloop;
+ }
+
+ }
+_loop367_breakloop: ;
+ } // ( ... )*
+ match("*/");
+ if (0==inputState.guessing)
+ {
+ _ttype = Token.SKIP;
+ }
+ if (_createToken && (null == _token) && (_ttype != Token.SKIP))
+ {
+ _token = makeToken(_ttype);
+ _token.setText(text.ToString(_begin, text.Length-_begin));
+ }
+ returnToken_ = _token;
+ }
+
+
+ private static long[] mk_tokenSet_0_()
+ {
+ long[] data = new long[1024];
+ data[0]=-145135534875656L;
+ for (int i = 1; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_0_ = new BitSet(mk_tokenSet_0_());
+ private static long[] mk_tokenSet_1_()
+ {
+ long[] data = new long[1024];
+ data[0]=-9224L;
+ for (int i = 1; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_1_ = new BitSet(mk_tokenSet_1_());
+ private static long[] mk_tokenSet_2_()
+ {
+ long[] data = new long[513];
+ data[0]=68719476736L;
+ data[1]=576460745995190270L;
+ for (int i = 2; i<=512; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_2_ = new BitSet(mk_tokenSet_2_());
+ private static long[] mk_tokenSet_3_()
+ {
+ long[] data = new long[1024];
+ data[0]=-17179878408L;
+ data[1]=-268435457L;
+ for (int i = 2; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_3_ = new BitSet(mk_tokenSet_3_());
+ private static long[] mk_tokenSet_4_()
+ {
+ long[] data = new long[1024];
+ data[0]=-549755823112L;
+ data[1]=-268435457L;
+ for (int i = 2; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_4_ = new BitSet(mk_tokenSet_4_());
+ private static long[] mk_tokenSet_5_()
+ {
+ long[] data = new long[1024];
+ data[0]=-8L;
+ data[1]=-576460752303423489L;
+ for (int i = 2; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_5_ = new BitSet(mk_tokenSet_5_());
+ private static long[] mk_tokenSet_6_()
+ {
+ long[] data = new long[1024];
+ data[0]=-1152921504606846984L;
+ data[1]=-576460752303423489L;
+ for (int i = 2; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_6_ = new BitSet(mk_tokenSet_6_());
+ private static long[] mk_tokenSet_7_()
+ {
+ long[] data = new long[1024];
+ data[0]=-1153062242095211528L;
+ data[1]=-576460752303423489L;
+ for (int i = 2; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_7_ = new BitSet(mk_tokenSet_7_());
+ private static long[] mk_tokenSet_8_()
+ {
+ long[] data = new long[1024];
+ data[0]=-35184372098056L;
+ for (int i = 1; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_8_ = new BitSet(mk_tokenSet_8_());
+ private static long[] mk_tokenSet_9_()
+ {
+ long[] data = new long[1024];
+ data[0]=-9224L;
+ data[1]=-536870913L;
+ for (int i = 2; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_9_ = new BitSet(mk_tokenSet_9_());
+ private static long[] mk_tokenSet_10_()
+ {
+ long[] data = new long[1024];
+ data[0]=-8L;
+ data[1]=-2882303761517117441L;
+ for (int i = 2; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_10_ = new BitSet(mk_tokenSet_10_());
+ private static long[] mk_tokenSet_11_()
+ {
+ long[] data = new long[513];
+ data[0]=287948901175001088L;
+ data[1]=541165879422L;
+ for (int i = 2; i<=512; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_11_ = new BitSet(mk_tokenSet_11_());
+ private static long[] mk_tokenSet_12_()
+ {
+ long[] data = new long[1024];
+ data[0]=-145135534875656L;
+ data[1]=-268435457L;
+ for (int i = 2; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_12_ = new BitSet(mk_tokenSet_12_());
+ private static long[] mk_tokenSet_13_()
+ {
+ long[] data = new long[1024];
+ data[0]=-140737488364552L;
+ data[1]=-268435457L;
+ for (int i = 2; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_13_ = new BitSet(mk_tokenSet_13_());
+ private static long[] mk_tokenSet_14_()
+ {
+ long[] data = new long[1024];
+ data[0]=-4398046520328L;
+ for (int i = 1; i<=510; i++) { data[i]=-1L; }
+ data[511]=9223372036854775807L;
+ for (int i = 512; i<=1023; i++) { data[i]=0L; }
+ return data;
+ }
+ public static readonly BitSet tokenSet_14_ = new BitSet(mk_tokenSet_14_());
+
}
}
diff --git a/External/Plugins/AS3Context/Grammar/AS3Parser.cs b/External/Plugins/AS3Context/Grammar/AS3Parser.cs
index 6037b7e559..c8616342c9 100644
--- a/External/Plugins/AS3Context/Grammar/AS3Parser.cs
+++ b/External/Plugins/AS3Context/Grammar/AS3Parser.cs
@@ -34,5806 +34,5806 @@
namespace AS3Context.Grammar
{
- // Generate the header common to all output files.
- using System;
-
- using TokenBuffer = antlr.TokenBuffer;
- using TokenStreamException = antlr.TokenStreamException;
- using TokenStreamIOException = antlr.TokenStreamIOException;
- using ANTLRException = antlr.ANTLRException;
- using LLkParser = antlr.LLkParser;
- using Token = antlr.Token;
- using IToken = antlr.IToken;
- using TokenStream = antlr.TokenStream;
- using RecognitionException = antlr.RecognitionException;
- using NoViableAltException = antlr.NoViableAltException;
- using MismatchedTokenException = antlr.MismatchedTokenException;
- using SemanticException = antlr.SemanticException;
- using ParserSharedInputState = antlr.ParserSharedInputState;
- using BitSet = antlr.collections.impl.BitSet;
- using AST = antlr.collections.AST;
- using ASTPair = antlr.ASTPair;
- using ASTFactory = antlr.ASTFactory;
- using ASTArray = antlr.collections.impl.ASTArray;
-
+ // Generate the header common to all output files.
+ using System;
+
+ using TokenBuffer = antlr.TokenBuffer;
+ using TokenStreamException = antlr.TokenStreamException;
+ using TokenStreamIOException = antlr.TokenStreamIOException;
+ using ANTLRException = antlr.ANTLRException;
+ using LLkParser = antlr.LLkParser;
+ using Token = antlr.Token;
+ using IToken = antlr.IToken;
+ using TokenStream = antlr.TokenStream;
+ using RecognitionException = antlr.RecognitionException;
+ using NoViableAltException = antlr.NoViableAltException;
+ using MismatchedTokenException = antlr.MismatchedTokenException;
+ using SemanticException = antlr.SemanticException;
+ using ParserSharedInputState = antlr.ParserSharedInputState;
+ using BitSet = antlr.collections.impl.BitSet;
+ using AST = antlr.collections.AST;
+ using ASTPair = antlr.ASTPair;
+ using ASTFactory = antlr.ASTFactory;
+ using ASTArray = antlr.collections.impl.ASTArray;
+
/**
- * @author Martin Schnabel
+ * @author Martin Schnabel
*/
- public class AS3Parser : antlr.LLkParser
- {
- public const int EOF = 1;
- public const int NULL_TREE_LOOKAHEAD = 3;
- public const int COMPILATION_UNIT = 4;
- public const int IMPORT = 5;
- public const int CLASS_DEF = 6;
- public const int INTERFACE_DEF = 7;
- public const int EXTENDS_CLAUSE = 8;
- public const int IMPLEMENTS_CLAUSE = 9;
- public const int TYPE_BLOCK = 10;
- public const int MODIFIERS = 11;
- public const int VARIABLE_DEF = 12;
- public const int METHOD_DEF = 13;
- public const int NAMESPACE_DEF = 14;
- public const int PARAMS = 15;
- public const int PARAM = 16;
- public const int TYPE_SPEC = 17;
- public const int BLOCK = 18;
- public const int EXPR = 19;
- public const int ELIST = 20;
- public const int EXPR_STMNT = 21;
- public const int NEW_EXPR = 22;
- public const int ENCPS_EXPR = 23;
- public const int VAR_INIT = 24;
- public const int METHOD_CALL = 25;
- public const int ARRAY_ACC = 26;
- public const int UNARY_PLUS = 27;
- public const int UNARY_MINUS = 28;
- public const int POST_INC = 29;
- public const int POST_DEC = 30;
- public const int ARRAY_LITERAL = 31;
- public const int ELEMENT = 32;
- public const int OBJECT_LITERAL = 33;
- public const int OBJECT_FIELD = 34;
- public const int FUNC_DEF = 35;
- public const int FOR_INIT = 36;
- public const int FOR_CONDITION = 37;
- public const int FOR_ITERATOR = 38;
- public const int LITERAL_package = 39;
- public const int LCURLY = 40;
- public const int SEMI = 41;
- public const int RCURLY = 42;
- public const int LITERAL_import = 43;
- public const int LBRACK = 44;
- public const int COMMA = 45;
- public const int RBRACK = 46;
- public const int LPAREN = 47;
- public const int RPAREN = 48;
- public const int LITERAL_class = 49;
- public const int LITERAL_interface = 50;
- public const int LITERAL_extends = 51;
- public const int LITERAL_implements = 52;
- public const int LITERAL_function = 53;
- public const int LITERAL_get = 54;
- public const int LITERAL_set = 55;
- // "/n" = 56
- // "/r" = 57
- public const int IDENT = 58;
- public const int LITERAL_namespace = 59;
- public const int LITERAL_var = 60;
- public const int LITERAL_const = 61;
- public const int ASSIGN = 62;
- public const int REST = 63;
- public const int LITERAL_while = 64;
- public const int LITERAL_do = 65;
- public const int LITERAL_with = 66;
- public const int LITERAL_if = 67;
- public const int LITERAL_else = 68;
- public const int LITERAL_throw = 69;
- public const int LITERAL_return = 70;
- public const int LITERAL_continue = 71;
- public const int LITERAL_break = 72;
- public const int LITERAL_switch = 73;
- public const int LITERAL_case = 74;
- public const int COLON = 75;
- public const int LITERAL_default = 76;
- public const int LITERAL_for = 77;
- public const int LITERAL_each = 78;
- public const int LITERAL_in = 79;
- public const int DOT = 80;
- public const int STAR = 81;
- public const int LITERAL_public = 82;
- public const int LITERAL_private = 83;
- public const int LITERAL_protected = 84;
- public const int LITERAL_internal = 85;
- public const int LITERAL_static = 86;
- public const int LITERAL_final = 87;
- public const int LITERAL_enumerable = 88;
- public const int LITERAL_explicit = 89;
- public const int LITERAL_override = 90;
- public const int LITERAL_dynamic = 91;
- public const int NUMBER = 92;
- public const int STAR_ASSIGN = 93;
- public const int DIV_ASSIGN = 94;
- public const int MOD_ASSIGN = 95;
- public const int PLUS_ASSIGN = 96;
- public const int MINUS_ASSIGN = 97;
- public const int SL_ASSIGN = 98;
- public const int SR_ASSIGN = 99;
- public const int BSR_ASSIGN = 100;
- public const int BAND_ASSIGN = 101;
- public const int BXOR_ASSIGN = 102;
- public const int BOR_ASSIGN = 103;
- public const int LAND_ASSIGN = 104;
- public const int LOR_ASSIGN = 105;
- public const int QUESTION = 106;
- public const int LOR = 107;
- public const int LAND = 108;
- public const int BOR = 109;
- public const int BXOR = 110;
- public const int BAND = 111;
- public const int STRICT_EQUAL = 112;
- public const int STRICT_NOT_EQUAL = 113;
- public const int NOT_EQUAL = 114;
- public const int EQUAL = 115;
- public const int LWT = 116;
- public const int GT = 117;
- public const int LE = 118;
- public const int GE = 119;
- public const int LITERAL_is = 120;
- public const int LITERAL_as = 121;
- public const int SL = 122;
- public const int SR = 123;
- public const int BSR = 124;
- public const int PLUS = 125;
- public const int MINUS = 126;
- public const int DIV = 127;
- public const int MOD = 128;
- public const int INC = 129;
- public const int DEC = 130;
- public const int LITERAL_delete = 131;
- public const int LITERAL_typeof = 132;
- public const int LNOT = 133;
- public const int BNOT = 134;
- public const int E4X_DESC = 135;
- public const int E4X_ATTRI = 136;
- public const int LITERAL_null = 137;
- public const int LITERAL_true = 138;
- public const int LITERAL_false = 139;
- public const int LITERAL_undefined = 140;
- public const int STRING_LITERAL = 141;
- public const int REGEX_LITERAL = 142;
- public const int XML_LITERAL = 143;
- public const int LITERAL_new = 144;
- public const int DBL_COLON = 145;
- public const int XML_ATTRIBUTE = 146;
- public const int XML_BINDING = 147;
- public const int XML_AS3_EXPRESSION = 148;
- public const int XML_TEXTNODE = 149;
- public const int XML_COMMENT = 150;
- public const int XML_CDATA = 151;
- public const int REGEX_BODY = 152;
- public const int WS = 153;
- public const int NL = 154;
- public const int BOM = 155;
- public const int SL_COMMENT = 156;
- public const int ML_COMMENT = 157;
- public const int EXPONENT = 158;
- public const int HEX_DIGIT = 159;
- public const int ESC = 160;
-
-
- private void setRegionInfo(AST ast,AST startAST,AST endAST){
- // do something with the model
- }
-
- protected void initialize()
- {
- tokenNames = tokenNames_;
- initializeFactory();
- }
-
-
- protected AS3Parser(TokenBuffer tokenBuf, int k) : base(tokenBuf, k)
- {
- initialize();
- }
-
- public AS3Parser(TokenBuffer tokenBuf) : this(tokenBuf,2)
- {
- }
-
- protected AS3Parser(TokenStream lexer, int k) : base(lexer,k)
- {
- initialize();
- }
-
- public AS3Parser(TokenStream lexer) : this(lexer,2)
- {
- }
-
- public AS3Parser(ParserSharedInputState state) : base(state,2)
- {
- initialize();
- }
-
+ public class AS3Parser : antlr.LLkParser
+ {
+ public const int EOF = 1;
+ public const int NULL_TREE_LOOKAHEAD = 3;
+ public const int COMPILATION_UNIT = 4;
+ public const int IMPORT = 5;
+ public const int CLASS_DEF = 6;
+ public const int INTERFACE_DEF = 7;
+ public const int EXTENDS_CLAUSE = 8;
+ public const int IMPLEMENTS_CLAUSE = 9;
+ public const int TYPE_BLOCK = 10;
+ public const int MODIFIERS = 11;
+ public const int VARIABLE_DEF = 12;
+ public const int METHOD_DEF = 13;
+ public const int NAMESPACE_DEF = 14;
+ public const int PARAMS = 15;
+ public const int PARAM = 16;
+ public const int TYPE_SPEC = 17;
+ public const int BLOCK = 18;
+ public const int EXPR = 19;
+ public const int ELIST = 20;
+ public const int EXPR_STMNT = 21;
+ public const int NEW_EXPR = 22;
+ public const int ENCPS_EXPR = 23;
+ public const int VAR_INIT = 24;
+ public const int METHOD_CALL = 25;
+ public const int ARRAY_ACC = 26;
+ public const int UNARY_PLUS = 27;
+ public const int UNARY_MINUS = 28;
+ public const int POST_INC = 29;
+ public const int POST_DEC = 30;
+ public const int ARRAY_LITERAL = 31;
+ public const int ELEMENT = 32;
+ public const int OBJECT_LITERAL = 33;
+ public const int OBJECT_FIELD = 34;
+ public const int FUNC_DEF = 35;
+ public const int FOR_INIT = 36;
+ public const int FOR_CONDITION = 37;
+ public const int FOR_ITERATOR = 38;
+ public const int LITERAL_package = 39;
+ public const int LCURLY = 40;
+ public const int SEMI = 41;
+ public const int RCURLY = 42;
+ public const int LITERAL_import = 43;
+ public const int LBRACK = 44;
+ public const int COMMA = 45;
+ public const int RBRACK = 46;
+ public const int LPAREN = 47;
+ public const int RPAREN = 48;
+ public const int LITERAL_class = 49;
+ public const int LITERAL_interface = 50;
+ public const int LITERAL_extends = 51;
+ public const int LITERAL_implements = 52;
+ public const int LITERAL_function = 53;
+ public const int LITERAL_get = 54;
+ public const int LITERAL_set = 55;
+ // "/n" = 56
+ // "/r" = 57
+ public const int IDENT = 58;
+ public const int LITERAL_namespace = 59;
+ public const int LITERAL_var = 60;
+ public const int LITERAL_const = 61;
+ public const int ASSIGN = 62;
+ public const int REST = 63;
+ public const int LITERAL_while = 64;
+ public const int LITERAL_do = 65;
+ public const int LITERAL_with = 66;
+ public const int LITERAL_if = 67;
+ public const int LITERAL_else = 68;
+ public const int LITERAL_throw = 69;
+ public const int LITERAL_return = 70;
+ public const int LITERAL_continue = 71;
+ public const int LITERAL_break = 72;
+ public const int LITERAL_switch = 73;
+ public const int LITERAL_case = 74;
+ public const int COLON = 75;
+ public const int LITERAL_default = 76;
+ public const int LITERAL_for = 77;
+ public const int LITERAL_each = 78;
+ public const int LITERAL_in = 79;
+ public const int DOT = 80;
+ public const int STAR = 81;
+ public const int LITERAL_public = 82;
+ public const int LITERAL_private = 83;
+ public const int LITERAL_protected = 84;
+ public const int LITERAL_internal = 85;
+ public const int LITERAL_static = 86;
+ public const int LITERAL_final = 87;
+ public const int LITERAL_enumerable = 88;
+ public const int LITERAL_explicit = 89;
+ public const int LITERAL_override = 90;
+ public const int LITERAL_dynamic = 91;
+ public const int NUMBER = 92;
+ public const int STAR_ASSIGN = 93;
+ public const int DIV_ASSIGN = 94;
+ public const int MOD_ASSIGN = 95;
+ public const int PLUS_ASSIGN = 96;
+ public const int MINUS_ASSIGN = 97;
+ public const int SL_ASSIGN = 98;
+ public const int SR_ASSIGN = 99;
+ public const int BSR_ASSIGN = 100;
+ public const int BAND_ASSIGN = 101;
+ public const int BXOR_ASSIGN = 102;
+ public const int BOR_ASSIGN = 103;
+ public const int LAND_ASSIGN = 104;
+ public const int LOR_ASSIGN = 105;
+ public const int QUESTION = 106;
+ public const int LOR = 107;
+ public const int LAND = 108;
+ public const int BOR = 109;
+ public const int BXOR = 110;
+ public const int BAND = 111;
+ public const int STRICT_EQUAL = 112;
+ public const int STRICT_NOT_EQUAL = 113;
+ public const int NOT_EQUAL = 114;
+ public const int EQUAL = 115;
+ public const int LWT = 116;
+ public const int GT = 117;
+ public const int LE = 118;
+ public const int GE = 119;
+ public const int LITERAL_is = 120;
+ public const int LITERAL_as = 121;
+ public const int SL = 122;
+ public const int SR = 123;
+ public const int BSR = 124;
+ public const int PLUS = 125;
+ public const int MINUS = 126;
+ public const int DIV = 127;
+ public const int MOD = 128;
+ public const int INC = 129;
+ public const int DEC = 130;
+ public const int LITERAL_delete = 131;
+ public const int LITERAL_typeof = 132;
+ public const int LNOT = 133;
+ public const int BNOT = 134;
+ public const int E4X_DESC = 135;
+ public const int E4X_ATTRI = 136;
+ public const int LITERAL_null = 137;
+ public const int LITERAL_true = 138;
+ public const int LITERAL_false = 139;
+ public const int LITERAL_undefined = 140;
+ public const int STRING_LITERAL = 141;
+ public const int REGEX_LITERAL = 142;
+ public const int XML_LITERAL = 143;
+ public const int LITERAL_new = 144;
+ public const int DBL_COLON = 145;
+ public const int XML_ATTRIBUTE = 146;
+ public const int XML_BINDING = 147;
+ public const int XML_AS3_EXPRESSION = 148;
+ public const int XML_TEXTNODE = 149;
+ public const int XML_COMMENT = 150;
+ public const int XML_CDATA = 151;
+ public const int REGEX_BODY = 152;
+ public const int WS = 153;
+ public const int NL = 154;
+ public const int BOM = 155;
+ public const int SL_COMMENT = 156;
+ public const int ML_COMMENT = 157;
+ public const int EXPONENT = 158;
+ public const int HEX_DIGIT = 159;
+ public const int ESC = 160;
+
+
+ private void setRegionInfo(AST ast,AST startAST,AST endAST){
+ // do something with the model
+ }
+
+ protected void initialize()
+ {
+ tokenNames = tokenNames_;
+ initializeFactory();
+ }
+
+
+ protected AS3Parser(TokenBuffer tokenBuf, int k) : base(tokenBuf, k)
+ {
+ initialize();
+ }
+
+ public AS3Parser(TokenBuffer tokenBuf) : this(tokenBuf,2)
+ {
+ }
+
+ protected AS3Parser(TokenStream lexer, int k) : base(lexer,k)
+ {
+ initialize();
+ }
+
+ public AS3Parser(TokenStream lexer) : this(lexer,2)
+ {
+ }
+
+ public AS3Parser(ParserSharedInputState state) : base(state,2)
+ {
+ initialize();
+ }
+
/**
* this is the start rule for this parser
*/
- public void compilationUnit() //throws RecognitionException, TokenStreamException
+ public void compilationUnit() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST compilationUnit_AST = null;
- AST mods_AST = null;
-
- AST tmp1_AST = null;
- tmp1_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp1_AST);
- match(LITERAL_package);
- {
- switch ( LA(1) )
- {
- case IDENT:
- {
- identifier();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LCURLY:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- match(LCURLY);
- { // ( ... )*
- for (;;)
- {
- switch ( LA(1) )
- {
- case LITERAL_import:
- {
- importDefinition();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LBRACK:
- {
- metadataDefinition();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LITERAL_class:
- case LITERAL_interface:
- case LITERAL_function:
- case LITERAL_namespace:
- case LITERAL_var:
- case LITERAL_const:
- case LITERAL_public:
- case LITERAL_private:
- case LITERAL_protected:
- case LITERAL_internal:
- case LITERAL_static:
- case LITERAL_final:
- case LITERAL_enumerable:
- case LITERAL_explicit:
- case LITERAL_override:
- case LITERAL_dynamic:
- {
- modifiers();
- if (0 == inputState.guessing)
- {
- mods_AST = (AST)returnAST;
- }
- {
- switch ( LA(1) )
- {
- case LITERAL_class:
- {
- classDefinition(mods_AST);
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LITERAL_interface:
- {
- interfaceDefinition(mods_AST);
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LITERAL_var:
- case LITERAL_const:
- {
- variableDefinition(mods_AST);
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LITERAL_function:
- {
- methodDefinition(mods_AST);
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LITERAL_namespace:
- {
- namespaceDefinition(mods_AST);
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- break;
- }
- case SEMI:
- {
- match(SEMI);
- break;
- }
- default:
- {
- goto _loop5_breakloop;
- }
- }
- }
-_loop5_breakloop: ;
- } // ( ... )*
- match(RCURLY);
- match(Token.EOF_TYPE);
- if (0==inputState.guessing)
- {
- compilationUnit_AST = (AST)currentAST.root;
- compilationUnit_AST = (AST) astFactory.make(astFactory.create(COMPILATION_UNIT,"COMPILATION_UNIT"), compilationUnit_AST);
- currentAST.root = compilationUnit_AST;
- if ( (null != compilationUnit_AST) && (null != compilationUnit_AST.getFirstChild()) )
- currentAST.child = compilationUnit_AST.getFirstChild();
- else
- currentAST.child = compilationUnit_AST;
- currentAST.advanceChildToEnd();
- }
- compilationUnit_AST = currentAST.root;
- returnAST = compilationUnit_AST;
- }
-
- public void identifier() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST compilationUnit_AST = null;
+ AST mods_AST = null;
+
+ AST tmp1_AST = null;
+ tmp1_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp1_AST);
+ match(LITERAL_package);
+ {
+ switch ( LA(1) )
+ {
+ case IDENT:
+ {
+ identifier();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ match(LCURLY);
+ { // ( ... )*
+ for (;;)
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_import:
+ {
+ importDefinition();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LBRACK:
+ {
+ metadataDefinition();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LITERAL_class:
+ case LITERAL_interface:
+ case LITERAL_function:
+ case LITERAL_namespace:
+ case LITERAL_var:
+ case LITERAL_const:
+ case LITERAL_public:
+ case LITERAL_private:
+ case LITERAL_protected:
+ case LITERAL_internal:
+ case LITERAL_static:
+ case LITERAL_final:
+ case LITERAL_enumerable:
+ case LITERAL_explicit:
+ case LITERAL_override:
+ case LITERAL_dynamic:
+ {
+ modifiers();
+ if (0 == inputState.guessing)
+ {
+ mods_AST = (AST)returnAST;
+ }
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_class:
+ {
+ classDefinition(mods_AST);
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LITERAL_interface:
+ {
+ interfaceDefinition(mods_AST);
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LITERAL_var:
+ case LITERAL_const:
+ {
+ variableDefinition(mods_AST);
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LITERAL_function:
+ {
+ methodDefinition(mods_AST);
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LITERAL_namespace:
+ {
+ namespaceDefinition(mods_AST);
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case SEMI:
+ {
+ match(SEMI);
+ break;
+ }
+ default:
+ {
+ goto _loop5_breakloop;
+ }
+ }
+ }
+_loop5_breakloop: ;
+ } // ( ... )*
+ match(RCURLY);
+ match(Token.EOF_TYPE);
+ if (0==inputState.guessing)
+ {
+ compilationUnit_AST = (AST)currentAST.root;
+ compilationUnit_AST = (AST) astFactory.make(astFactory.create(COMPILATION_UNIT,"COMPILATION_UNIT"), compilationUnit_AST);
+ currentAST.root = compilationUnit_AST;
+ if ( (null != compilationUnit_AST) && (null != compilationUnit_AST.getFirstChild()) )
+ currentAST.child = compilationUnit_AST.getFirstChild();
+ else
+ currentAST.child = compilationUnit_AST;
+ currentAST.advanceChildToEnd();
+ }
+ compilationUnit_AST = currentAST.root;
+ returnAST = compilationUnit_AST;
+ }
+
+ public void identifier() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST identifier_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(IDENT);
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==DOT))
- {
- match(DOT);
- e = LT(1);
- e_AST = astFactory.create(e);
- astFactory.makeASTRoot(ref currentAST, e_AST);
- match(IDENT);
- if (0==inputState.guessing)
- {
- identifier_AST = (AST)currentAST.root;
- setRegionInfo(identifier_AST,s_AST,e_AST);
- }
- }
- else
- {
- goto _loop112_breakloop;
- }
-
- }
-_loop112_breakloop: ;
- } // ( ... )*
- if (0==inputState.guessing)
- {
- identifier_AST = (AST)currentAST.root;
- setRegionInfo(identifier_AST,s_AST,e_AST);
- }
- identifier_AST = currentAST.root;
- returnAST = identifier_AST;
- }
-
- public void importDefinition() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST identifier_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(IDENT);
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==DOT))
+ {
+ match(DOT);
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ astFactory.makeASTRoot(ref currentAST, e_AST);
+ match(IDENT);
+ if (0==inputState.guessing)
+ {
+ identifier_AST = (AST)currentAST.root;
+ setRegionInfo(identifier_AST,s_AST,e_AST);
+ }
+ }
+ else
+ {
+ goto _loop112_breakloop;
+ }
+
+ }
+_loop112_breakloop: ;
+ } // ( ... )*
+ if (0==inputState.guessing)
+ {
+ identifier_AST = (AST)currentAST.root;
+ setRegionInfo(identifier_AST,s_AST,e_AST);
+ }
+ identifier_AST = currentAST.root;
+ returnAST = identifier_AST;
+ }
+
+ public void importDefinition() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST importDefinition_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LITERAL_import);
- identifierStar();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- importDefinition_AST = (AST)currentAST.root;
- importDefinition_AST = (AST) astFactory.make(astFactory.create(IMPORT,"IMPORT"), importDefinition_AST);
- setRegionInfo(importDefinition_AST,s_AST,e_AST);
- currentAST.root = importDefinition_AST;
- if ( (null != importDefinition_AST) && (null != importDefinition_AST.getFirstChild()) )
- currentAST.child = importDefinition_AST.getFirstChild();
- else
- currentAST.child = importDefinition_AST;
- currentAST.advanceChildToEnd();
- }
- importDefinition_AST = currentAST.root;
- returnAST = importDefinition_AST;
- }
-
- public void metadataDefinition() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST importDefinition_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LITERAL_import);
+ identifierStar();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ importDefinition_AST = (AST)currentAST.root;
+ importDefinition_AST = (AST) astFactory.make(astFactory.create(IMPORT,"IMPORT"), importDefinition_AST);
+ setRegionInfo(importDefinition_AST,s_AST,e_AST);
+ currentAST.root = importDefinition_AST;
+ if ( (null != importDefinition_AST) && (null != importDefinition_AST.getFirstChild()) )
+ currentAST.child = importDefinition_AST.getFirstChild();
+ else
+ currentAST.child = importDefinition_AST;
+ currentAST.advanceChildToEnd();
+ }
+ importDefinition_AST = currentAST.root;
+ returnAST = importDefinition_AST;
+ }
+
+ public void metadataDefinition() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST metadataDefinition_AST = null;
-
- AST tmp7_AST = null;
- tmp7_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp7_AST);
- match(LBRACK);
- {
- metadataItem();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==COMMA))
- {
- match(COMMA);
- metadataItem();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop10_breakloop;
- }
-
- }
-_loop10_breakloop: ;
- } // ( ... )*
- }
- AST tmp9_AST = null;
- tmp9_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp9_AST);
- match(RBRACK);
- metadataDefinition_AST = currentAST.root;
- returnAST = metadataDefinition_AST;
- }
-
- public void modifiers() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST metadataDefinition_AST = null;
+
+ AST tmp7_AST = null;
+ tmp7_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp7_AST);
+ match(LBRACK);
+ {
+ metadataItem();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==COMMA))
+ {
+ match(COMMA);
+ metadataItem();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop10_breakloop;
+ }
+
+ }
+_loop10_breakloop: ;
+ } // ( ... )*
+ }
+ AST tmp9_AST = null;
+ tmp9_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp9_AST);
+ match(RBRACK);
+ metadataDefinition_AST = currentAST.root;
+ returnAST = metadataDefinition_AST;
+ }
+
+ public void modifiers() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST modifiers_AST = null;
- AST s_AST = null;
- AST e_AST = null;
-
- {
- switch ( LA(1) )
- {
- case LITERAL_public:
- case LITERAL_private:
- case LITERAL_protected:
- case LITERAL_internal:
- case LITERAL_static:
- case LITERAL_final:
- case LITERAL_enumerable:
- case LITERAL_explicit:
- case LITERAL_override:
- case LITERAL_dynamic:
- {
- modifier();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if (((LA(1) >= LITERAL_public && LA(1) <= LITERAL_dynamic)))
- {
- modifier();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop120_breakloop;
- }
-
- }
-_loop120_breakloop: ;
- } // ( ... )*
- break;
- }
- case LITERAL_class:
- case LITERAL_interface:
- case LITERAL_function:
- case LITERAL_namespace:
- case LITERAL_var:
- case LITERAL_const:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- if (0==inputState.guessing)
- {
- modifiers_AST = (AST)currentAST.root;
- modifiers_AST = (AST) astFactory.make(astFactory.create(MODIFIERS,"MODIFIERS"), modifiers_AST);
- setRegionInfo(modifiers_AST,s_AST,e_AST);
- currentAST.root = modifiers_AST;
- if ( (null != modifiers_AST) && (null != modifiers_AST.getFirstChild()) )
- currentAST.child = modifiers_AST.getFirstChild();
- else
- currentAST.child = modifiers_AST;
- currentAST.advanceChildToEnd();
- }
- modifiers_AST = currentAST.root;
- returnAST = modifiers_AST;
- }
-
- public void classDefinition(
- AST mods
- ) //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST modifiers_AST = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_public:
+ case LITERAL_private:
+ case LITERAL_protected:
+ case LITERAL_internal:
+ case LITERAL_static:
+ case LITERAL_final:
+ case LITERAL_enumerable:
+ case LITERAL_explicit:
+ case LITERAL_override:
+ case LITERAL_dynamic:
+ {
+ modifier();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if (((LA(1) >= LITERAL_public && LA(1) <= LITERAL_dynamic)))
+ {
+ modifier();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop120_breakloop;
+ }
+
+ }
+_loop120_breakloop: ;
+ } // ( ... )*
+ break;
+ }
+ case LITERAL_class:
+ case LITERAL_interface:
+ case LITERAL_function:
+ case LITERAL_namespace:
+ case LITERAL_var:
+ case LITERAL_const:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if (0==inputState.guessing)
+ {
+ modifiers_AST = (AST)currentAST.root;
+ modifiers_AST = (AST) astFactory.make(astFactory.create(MODIFIERS,"MODIFIERS"), modifiers_AST);
+ setRegionInfo(modifiers_AST,s_AST,e_AST);
+ currentAST.root = modifiers_AST;
+ if ( (null != modifiers_AST) && (null != modifiers_AST.getFirstChild()) )
+ currentAST.child = modifiers_AST.getFirstChild();
+ else
+ currentAST.child = modifiers_AST;
+ currentAST.advanceChildToEnd();
+ }
+ modifiers_AST = currentAST.root;
+ returnAST = modifiers_AST;
+ }
+
+ public void classDefinition(
+ AST mods
+ ) //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST classDefinition_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LITERAL_class);
- identifier();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- extendsClause();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- implementsClause();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- typeBlock();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- classDefinition_AST = (AST)currentAST.root;
- classDefinition_AST = (AST) astFactory.make(astFactory.create(CLASS_DEF,"CLASS_DEF"), classDefinition_AST, mods);
- setRegionInfo(classDefinition_AST,s_AST,e_AST);
- currentAST.root = classDefinition_AST;
- if ( (null != classDefinition_AST) && (null != classDefinition_AST.getFirstChild()) )
- currentAST.child = classDefinition_AST.getFirstChild();
- else
- currentAST.child = classDefinition_AST;
- currentAST.advanceChildToEnd();
- }
- classDefinition_AST = currentAST.root;
- returnAST = classDefinition_AST;
- }
-
- public void interfaceDefinition(
- AST mods
- ) //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST classDefinition_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LITERAL_class);
+ identifier();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ extendsClause();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ implementsClause();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ typeBlock();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ classDefinition_AST = (AST)currentAST.root;
+ classDefinition_AST = (AST) astFactory.make(astFactory.create(CLASS_DEF,"CLASS_DEF"), classDefinition_AST, mods);
+ setRegionInfo(classDefinition_AST,s_AST,e_AST);
+ currentAST.root = classDefinition_AST;
+ if ( (null != classDefinition_AST) && (null != classDefinition_AST.getFirstChild()) )
+ currentAST.child = classDefinition_AST.getFirstChild();
+ else
+ currentAST.child = classDefinition_AST;
+ currentAST.advanceChildToEnd();
+ }
+ classDefinition_AST = currentAST.root;
+ returnAST = classDefinition_AST;
+ }
+
+ public void interfaceDefinition(
+ AST mods
+ ) //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST interfaceDefinition_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LITERAL_interface);
- identifier();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- extendsClause();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- typeBlock();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- interfaceDefinition_AST = (AST)currentAST.root;
- interfaceDefinition_AST = (AST) astFactory.make(astFactory.create(INTERFACE_DEF,"INTERFACE_DEF"), interfaceDefinition_AST, mods);
- setRegionInfo(interfaceDefinition_AST,s_AST,e_AST);
- currentAST.root = interfaceDefinition_AST;
- if ( (null != interfaceDefinition_AST) && (null != interfaceDefinition_AST.getFirstChild()) )
- currentAST.child = interfaceDefinition_AST.getFirstChild();
- else
- currentAST.child = interfaceDefinition_AST;
- currentAST.advanceChildToEnd();
- }
- interfaceDefinition_AST = currentAST.root;
- returnAST = interfaceDefinition_AST;
- }
-
- public void variableDefinition(
- AST mods
- ) //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST interfaceDefinition_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LITERAL_interface);
+ identifier();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ extendsClause();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ typeBlock();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ interfaceDefinition_AST = (AST)currentAST.root;
+ interfaceDefinition_AST = (AST) astFactory.make(astFactory.create(INTERFACE_DEF,"INTERFACE_DEF"), interfaceDefinition_AST, mods);
+ setRegionInfo(interfaceDefinition_AST,s_AST,e_AST);
+ currentAST.root = interfaceDefinition_AST;
+ if ( (null != interfaceDefinition_AST) && (null != interfaceDefinition_AST.getFirstChild()) )
+ currentAST.child = interfaceDefinition_AST.getFirstChild();
+ else
+ currentAST.child = interfaceDefinition_AST;
+ currentAST.advanceChildToEnd();
+ }
+ interfaceDefinition_AST = currentAST.root;
+ returnAST = interfaceDefinition_AST;
+ }
+
+ public void variableDefinition(
+ AST mods
+ ) //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST variableDefinition_AST = null;
-
- {
- switch ( LA(1) )
- {
- case LITERAL_var:
- {
- match(LITERAL_var);
- break;
- }
- case LITERAL_const:
- {
- match(LITERAL_const);
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- variableDeclarator(getASTFactory().dupTree(mods));
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==COMMA))
- {
- match(COMMA);
- variableDeclarator(getASTFactory().dupTree(mods));
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop38_breakloop;
- }
-
- }
-_loop38_breakloop: ;
- } // ( ... )*
- variableDefinition_AST = currentAST.root;
- returnAST = variableDefinition_AST;
- }
-
- public void methodDefinition(
- AST mods
- ) //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST variableDefinition_AST = null;
+
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_var:
+ {
+ match(LITERAL_var);
+ break;
+ }
+ case LITERAL_const:
+ {
+ match(LITERAL_const);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ variableDeclarator(getASTFactory().dupTree(mods));
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==COMMA))
+ {
+ match(COMMA);
+ variableDeclarator(getASTFactory().dupTree(mods));
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop38_breakloop;
+ }
+
+ }
+_loop38_breakloop: ;
+ } // ( ... )*
+ variableDefinition_AST = currentAST.root;
+ returnAST = variableDefinition_AST;
+ }
+
+ public void methodDefinition(
+ AST mods
+ ) //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST methodDefinition_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e1_AST = null;
- AST e2_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LITERAL_function);
- {
- switch ( LA(1) )
- {
- case LITERAL_get:
- case LITERAL_set:
- {
- {
- switch ( LA(1) )
- {
- case LITERAL_get:
- {
- AST tmp13_AST = null;
- tmp13_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp13_AST);
- match(LITERAL_get);
- break;
- }
- case LITERAL_set:
- {
- AST tmp14_AST = null;
- tmp14_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp14_AST);
- match(LITERAL_set);
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- {
- AST tmp15_AST = null;
- tmp15_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp15_AST);
- match(tokenSet_0_);
- }
- break;
- }
- case IDENT:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- AST tmp16_AST = null;
- tmp16_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp16_AST);
- match(IDENT);
- parameterDeclarationList();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- typeExpression();
- if (0 == inputState.guessing)
- {
- e1_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- {
- switch ( LA(1) )
- {
- case LCURLY:
- {
- block();
- if (0 == inputState.guessing)
- {
- e2_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case SEMI:
- case RCURLY:
- case LITERAL_import:
- case LBRACK:
- case LITERAL_class:
- case LITERAL_interface:
- case LITERAL_function:
- case LITERAL_namespace:
- case LITERAL_var:
- case LITERAL_const:
- case LITERAL_public:
- case LITERAL_private:
- case LITERAL_protected:
- case LITERAL_internal:
- case LITERAL_static:
- case LITERAL_final:
- case LITERAL_enumerable:
- case LITERAL_explicit:
- case LITERAL_override:
- case LITERAL_dynamic:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- if (0==inputState.guessing)
- {
- methodDefinition_AST = (AST)currentAST.root;
- methodDefinition_AST = (AST) astFactory.make(astFactory.create(METHOD_DEF,"METHOD_DEF"), methodDefinition_AST, mods);
- setRegionInfo(methodDefinition_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
- currentAST.root = methodDefinition_AST;
- if ( (null != methodDefinition_AST) && (null != methodDefinition_AST.getFirstChild()) )
- currentAST.child = methodDefinition_AST.getFirstChild();
- else
- currentAST.child = methodDefinition_AST;
- currentAST.advanceChildToEnd();
- }
- methodDefinition_AST = currentAST.root;
- returnAST = methodDefinition_AST;
- }
-
- public void namespaceDefinition(
- AST mods
- ) //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST methodDefinition_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e1_AST = null;
+ AST e2_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LITERAL_function);
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_get:
+ case LITERAL_set:
+ {
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_get:
+ {
+ AST tmp13_AST = null;
+ tmp13_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp13_AST);
+ match(LITERAL_get);
+ break;
+ }
+ case LITERAL_set:
+ {
+ AST tmp14_AST = null;
+ tmp14_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp14_AST);
+ match(LITERAL_set);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ AST tmp15_AST = null;
+ tmp15_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp15_AST);
+ match(tokenSet_0_);
+ }
+ break;
+ }
+ case IDENT:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ AST tmp16_AST = null;
+ tmp16_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp16_AST);
+ match(IDENT);
+ parameterDeclarationList();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ typeExpression();
+ if (0 == inputState.guessing)
+ {
+ e1_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ {
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ {
+ block();
+ if (0 == inputState.guessing)
+ {
+ e2_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case SEMI:
+ case RCURLY:
+ case LITERAL_import:
+ case LBRACK:
+ case LITERAL_class:
+ case LITERAL_interface:
+ case LITERAL_function:
+ case LITERAL_namespace:
+ case LITERAL_var:
+ case LITERAL_const:
+ case LITERAL_public:
+ case LITERAL_private:
+ case LITERAL_protected:
+ case LITERAL_internal:
+ case LITERAL_static:
+ case LITERAL_final:
+ case LITERAL_enumerable:
+ case LITERAL_explicit:
+ case LITERAL_override:
+ case LITERAL_dynamic:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if (0==inputState.guessing)
+ {
+ methodDefinition_AST = (AST)currentAST.root;
+ methodDefinition_AST = (AST) astFactory.make(astFactory.create(METHOD_DEF,"METHOD_DEF"), methodDefinition_AST, mods);
+ setRegionInfo(methodDefinition_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
+ currentAST.root = methodDefinition_AST;
+ if ( (null != methodDefinition_AST) && (null != methodDefinition_AST.getFirstChild()) )
+ currentAST.child = methodDefinition_AST.getFirstChild();
+ else
+ currentAST.child = methodDefinition_AST;
+ currentAST.advanceChildToEnd();
+ }
+ methodDefinition_AST = currentAST.root;
+ returnAST = methodDefinition_AST;
+ }
+
+ public void namespaceDefinition(
+ AST mods
+ ) //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST namespaceDefinition_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LITERAL_namespace);
- e = LT(1);
- e_AST = astFactory.create(e);
- astFactory.addASTChild(ref currentAST, e_AST);
- match(IDENT);
- if (0==inputState.guessing)
- {
- namespaceDefinition_AST = (AST)currentAST.root;
- namespaceDefinition_AST = (AST) astFactory.make(astFactory.create(NAMESPACE_DEF,"NAMESPACE_DEF"), namespaceDefinition_AST, mods);
- setRegionInfo(namespaceDefinition_AST,s_AST,e_AST);
- currentAST.root = namespaceDefinition_AST;
- if ( (null != namespaceDefinition_AST) && (null != namespaceDefinition_AST.getFirstChild()) )
- currentAST.child = namespaceDefinition_AST.getFirstChild();
- else
- currentAST.child = namespaceDefinition_AST;
- currentAST.advanceChildToEnd();
- }
- namespaceDefinition_AST = currentAST.root;
- returnAST = namespaceDefinition_AST;
- }
-
- public void identifierStar() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST namespaceDefinition_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LITERAL_namespace);
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ astFactory.addASTChild(ref currentAST, e_AST);
+ match(IDENT);
+ if (0==inputState.guessing)
+ {
+ namespaceDefinition_AST = (AST)currentAST.root;
+ namespaceDefinition_AST = (AST) astFactory.make(astFactory.create(NAMESPACE_DEF,"NAMESPACE_DEF"), namespaceDefinition_AST, mods);
+ setRegionInfo(namespaceDefinition_AST,s_AST,e_AST);
+ currentAST.root = namespaceDefinition_AST;
+ if ( (null != namespaceDefinition_AST) && (null != namespaceDefinition_AST.getFirstChild()) )
+ currentAST.child = namespaceDefinition_AST.getFirstChild();
+ else
+ currentAST.child = namespaceDefinition_AST;
+ currentAST.advanceChildToEnd();
+ }
+ namespaceDefinition_AST = currentAST.root;
+ returnAST = namespaceDefinition_AST;
+ }
+
+ public void identifierStar() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST identifierStar_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e1 = null;
- AST e1_AST = null;
- IToken e2 = null;
- AST e2_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(IDENT);
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==DOT) && (LA(2)==IDENT))
- {
- match(DOT);
- e1 = LT(1);
- e1_AST = astFactory.create(e1);
- astFactory.makeASTRoot(ref currentAST, e1_AST);
- match(IDENT);
- if (0==inputState.guessing)
- {
- identifierStar_AST = (AST)currentAST.root;
- setRegionInfo(identifierStar_AST,s_AST,e1_AST);
- }
- }
- else
- {
- goto _loop115_breakloop;
- }
-
- }
-_loop115_breakloop: ;
- } // ( ... )*
- {
- switch ( LA(1) )
- {
- case DOT:
- {
- match(DOT);
- e2 = LT(1);
- e2_AST = astFactory.create(e2);
- astFactory.makeASTRoot(ref currentAST, e2_AST);
- match(STAR);
- if (0==inputState.guessing)
- {
- identifierStar_AST = (AST)currentAST.root;
- setRegionInfo(identifierStar_AST,s_AST,e2_AST);
- }
- break;
- }
- case SEMI:
- case RCURLY:
- case LITERAL_import:
- case LBRACK:
- case LITERAL_class:
- case LITERAL_interface:
- case LITERAL_function:
- case LITERAL_namespace:
- case LITERAL_var:
- case LITERAL_const:
- case LITERAL_public:
- case LITERAL_private:
- case LITERAL_protected:
- case LITERAL_internal:
- case LITERAL_static:
- case LITERAL_final:
- case LITERAL_enumerable:
- case LITERAL_explicit:
- case LITERAL_override:
- case LITERAL_dynamic:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- if (0==inputState.guessing)
- {
- identifierStar_AST = (AST)currentAST.root;
- setRegionInfo(identifierStar_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
- }
- identifierStar_AST = currentAST.root;
- returnAST = identifierStar_AST;
- }
-
- public void metadataItem() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST identifierStar_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e1 = null;
+ AST e1_AST = null;
+ IToken e2 = null;
+ AST e2_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(IDENT);
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==DOT) && (LA(2)==IDENT))
+ {
+ match(DOT);
+ e1 = LT(1);
+ e1_AST = astFactory.create(e1);
+ astFactory.makeASTRoot(ref currentAST, e1_AST);
+ match(IDENT);
+ if (0==inputState.guessing)
+ {
+ identifierStar_AST = (AST)currentAST.root;
+ setRegionInfo(identifierStar_AST,s_AST,e1_AST);
+ }
+ }
+ else
+ {
+ goto _loop115_breakloop;
+ }
+
+ }
+_loop115_breakloop: ;
+ } // ( ... )*
+ {
+ switch ( LA(1) )
+ {
+ case DOT:
+ {
+ match(DOT);
+ e2 = LT(1);
+ e2_AST = astFactory.create(e2);
+ astFactory.makeASTRoot(ref currentAST, e2_AST);
+ match(STAR);
+ if (0==inputState.guessing)
+ {
+ identifierStar_AST = (AST)currentAST.root;
+ setRegionInfo(identifierStar_AST,s_AST,e2_AST);
+ }
+ break;
+ }
+ case SEMI:
+ case RCURLY:
+ case LITERAL_import:
+ case LBRACK:
+ case LITERAL_class:
+ case LITERAL_interface:
+ case LITERAL_function:
+ case LITERAL_namespace:
+ case LITERAL_var:
+ case LITERAL_const:
+ case LITERAL_public:
+ case LITERAL_private:
+ case LITERAL_protected:
+ case LITERAL_internal:
+ case LITERAL_static:
+ case LITERAL_final:
+ case LITERAL_enumerable:
+ case LITERAL_explicit:
+ case LITERAL_override:
+ case LITERAL_dynamic:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if (0==inputState.guessing)
+ {
+ identifierStar_AST = (AST)currentAST.root;
+ setRegionInfo(identifierStar_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
+ }
+ identifierStar_AST = currentAST.root;
+ returnAST = identifierStar_AST;
+ }
+
+ public void metadataItem() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST metadataItem_AST = null;
-
- identifier();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- {
- switch ( LA(1) )
- {
- case LPAREN:
- {
- AST tmp19_AST = null;
- tmp19_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp19_AST);
- match(LPAREN);
- {
- switch ( LA(1) )
- {
- case LCURLY:
- case LBRACK:
- case LPAREN:
- case LITERAL_function:
- case IDENT:
- case NUMBER:
- case PLUS:
- case MINUS:
- case INC:
- case DEC:
- case LITERAL_delete:
- case LITERAL_typeof:
- case LNOT:
- case BNOT:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- expression();
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==COMMA))
- {
- match(COMMA);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop15_breakloop;
- }
-
- }
-_loop15_breakloop: ;
- } // ( ... )*
- break;
- }
- case RPAREN:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- AST tmp21_AST = null;
- tmp21_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp21_AST);
- match(RPAREN);
- break;
- }
- case COMMA:
- case RBRACK:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- metadataItem_AST = currentAST.root;
- returnAST = metadataItem_AST;
- }
-
- public void expression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST metadataItem_AST = null;
+
+ identifier();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ {
+ switch ( LA(1) )
+ {
+ case LPAREN:
+ {
+ AST tmp19_AST = null;
+ tmp19_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp19_AST);
+ match(LPAREN);
+ {
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ case LBRACK:
+ case LPAREN:
+ case LITERAL_function:
+ case IDENT:
+ case NUMBER:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case LITERAL_delete:
+ case LITERAL_typeof:
+ case LNOT:
+ case BNOT:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ expression();
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==COMMA))
+ {
+ match(COMMA);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop15_breakloop;
+ }
+
+ }
+_loop15_breakloop: ;
+ } // ( ... )*
+ break;
+ }
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ AST tmp21_AST = null;
+ tmp21_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp21_AST);
+ match(RPAREN);
+ break;
+ }
+ case COMMA:
+ case RBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ metadataItem_AST = currentAST.root;
+ returnAST = metadataItem_AST;
+ }
+
+ public void expression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST expression_AST = null;
- AST s_AST = null;
-
- assignmentExpression();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- expression_AST = (AST)currentAST.root;
- expression_AST = (AST) astFactory.make(astFactory.create(EXPR,"EXPR"), expression_AST);
- setRegionInfo(expression_AST,s_AST,null);
- currentAST.root = expression_AST;
- if ( (null != expression_AST) && (null != expression_AST.getFirstChild()) )
- currentAST.child = expression_AST.getFirstChild();
- else
- currentAST.child = expression_AST;
- currentAST.advanceChildToEnd();
- }
- expression_AST = currentAST.root;
- returnAST = expression_AST;
- }
-
- public void extendsClause() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST expression_AST = null;
+ AST s_AST = null;
+
+ assignmentExpression();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ expression_AST = (AST)currentAST.root;
+ expression_AST = (AST) astFactory.make(astFactory.create(EXPR,"EXPR"), expression_AST);
+ setRegionInfo(expression_AST,s_AST,null);
+ currentAST.root = expression_AST;
+ if ( (null != expression_AST) && (null != expression_AST.getFirstChild()) )
+ currentAST.child = expression_AST.getFirstChild();
+ else
+ currentAST.child = expression_AST;
+ currentAST.advanceChildToEnd();
+ }
+ expression_AST = currentAST.root;
+ returnAST = expression_AST;
+ }
+
+ public void extendsClause() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST extendsClause_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e_AST = null;
-
- {
- switch ( LA(1) )
- {
- case LITERAL_extends:
- {
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LITERAL_extends);
- identifier();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LCURLY:
- case LITERAL_implements:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- if (0==inputState.guessing)
- {
- extendsClause_AST = (AST)currentAST.root;
- extendsClause_AST = (AST) astFactory.make(astFactory.create(EXTENDS_CLAUSE,"EXTENDS_CLAUSE"), extendsClause_AST);
- setRegionInfo(extendsClause_AST,s_AST,e_AST);
- currentAST.root = extendsClause_AST;
- if ( (null != extendsClause_AST) && (null != extendsClause_AST.getFirstChild()) )
- currentAST.child = extendsClause_AST.getFirstChild();
- else
- currentAST.child = extendsClause_AST;
- currentAST.advanceChildToEnd();
- }
- extendsClause_AST = currentAST.root;
- returnAST = extendsClause_AST;
- }
-
- public void implementsClause() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST extendsClause_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_extends:
+ {
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LITERAL_extends);
+ identifier();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LCURLY:
+ case LITERAL_implements:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if (0==inputState.guessing)
+ {
+ extendsClause_AST = (AST)currentAST.root;
+ extendsClause_AST = (AST) astFactory.make(astFactory.create(EXTENDS_CLAUSE,"EXTENDS_CLAUSE"), extendsClause_AST);
+ setRegionInfo(extendsClause_AST,s_AST,e_AST);
+ currentAST.root = extendsClause_AST;
+ if ( (null != extendsClause_AST) && (null != extendsClause_AST.getFirstChild()) )
+ currentAST.child = extendsClause_AST.getFirstChild();
+ else
+ currentAST.child = extendsClause_AST;
+ currentAST.advanceChildToEnd();
+ }
+ extendsClause_AST = currentAST.root;
+ returnAST = extendsClause_AST;
+ }
+
+ public void implementsClause() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST implementsClause_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e1_AST = null;
- AST e2_AST = null;
-
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==LITERAL_implements))
- {
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LITERAL_implements);
- identifier();
- if (0 == inputState.guessing)
- {
- e1_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==COMMA))
- {
- match(COMMA);
- identifier();
- if (0 == inputState.guessing)
- {
- e2_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop23_breakloop;
- }
-
- }
-_loop23_breakloop: ;
- } // ( ... )*
- }
- else
- {
- goto _loop24_breakloop;
- }
-
- }
-_loop24_breakloop: ;
- } // ( ... )*
- if (0==inputState.guessing)
- {
- implementsClause_AST = (AST)currentAST.root;
- implementsClause_AST = (AST) astFactory.make(astFactory.create(IMPLEMENTS_CLAUSE,"IMPLEMENTS_CLAUSE"), implementsClause_AST);
- setRegionInfo(implementsClause_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
- currentAST.root = implementsClause_AST;
- if ( (null != implementsClause_AST) && (null != implementsClause_AST.getFirstChild()) )
- currentAST.child = implementsClause_AST.getFirstChild();
- else
- currentAST.child = implementsClause_AST;
- currentAST.advanceChildToEnd();
- }
- implementsClause_AST = currentAST.root;
- returnAST = implementsClause_AST;
- }
-
- public void typeBlock() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST implementsClause_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e1_AST = null;
+ AST e2_AST = null;
+
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==LITERAL_implements))
+ {
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LITERAL_implements);
+ identifier();
+ if (0 == inputState.guessing)
+ {
+ e1_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==COMMA))
+ {
+ match(COMMA);
+ identifier();
+ if (0 == inputState.guessing)
+ {
+ e2_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop23_breakloop;
+ }
+
+ }
+_loop23_breakloop: ;
+ } // ( ... )*
+ }
+ else
+ {
+ goto _loop24_breakloop;
+ }
+
+ }
+_loop24_breakloop: ;
+ } // ( ... )*
+ if (0==inputState.guessing)
+ {
+ implementsClause_AST = (AST)currentAST.root;
+ implementsClause_AST = (AST) astFactory.make(astFactory.create(IMPLEMENTS_CLAUSE,"IMPLEMENTS_CLAUSE"), implementsClause_AST);
+ setRegionInfo(implementsClause_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
+ currentAST.root = implementsClause_AST;
+ if ( (null != implementsClause_AST) && (null != implementsClause_AST.getFirstChild()) )
+ currentAST.child = implementsClause_AST.getFirstChild();
+ else
+ currentAST.child = implementsClause_AST;
+ currentAST.advanceChildToEnd();
+ }
+ implementsClause_AST = currentAST.root;
+ returnAST = implementsClause_AST;
+ }
+
+ public void typeBlock() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST typeBlock_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST m_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LCURLY);
- { // ( ... )*
- for (;;)
- {
- switch ( LA(1) )
- {
- case LBRACK:
- {
- metadataDefinition();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LITERAL_function:
- case LITERAL_var:
- case LITERAL_const:
- case LITERAL_public:
- case LITERAL_private:
- case LITERAL_protected:
- case LITERAL_internal:
- case LITERAL_static:
- case LITERAL_final:
- case LITERAL_enumerable:
- case LITERAL_explicit:
- case LITERAL_override:
- case LITERAL_dynamic:
- {
- modifiers();
- if (0 == inputState.guessing)
- {
- m_AST = (AST)returnAST;
- }
- {
- switch ( LA(1) )
- {
- case LITERAL_var:
- case LITERAL_const:
- {
- variableDefinition(m_AST);
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LITERAL_function:
- {
- methodDefinition(m_AST);
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- break;
- }
- case SEMI:
- {
- match(SEMI);
- break;
- }
- default:
- {
- goto _loop28_breakloop;
- }
- }
- }
-_loop28_breakloop: ;
- } // ( ... )*
- e = LT(1);
- e_AST = astFactory.create(e);
- match(RCURLY);
- if (0==inputState.guessing)
- {
- typeBlock_AST = (AST)currentAST.root;
- typeBlock_AST = (AST) astFactory.make(astFactory.create(TYPE_BLOCK,"TYPE_BLOCK"), typeBlock_AST);
- setRegionInfo(typeBlock_AST,s_AST,e_AST);
- currentAST.root = typeBlock_AST;
- if ( (null != typeBlock_AST) && (null != typeBlock_AST.getFirstChild()) )
- currentAST.child = typeBlock_AST.getFirstChild();
- else
- currentAST.child = typeBlock_AST;
- currentAST.advanceChildToEnd();
- }
- typeBlock_AST = currentAST.root;
- returnAST = typeBlock_AST;
- }
-
- public void parameterDeclarationList() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST typeBlock_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST m_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LCURLY);
+ { // ( ... )*
+ for (;;)
+ {
+ switch ( LA(1) )
+ {
+ case LBRACK:
+ {
+ metadataDefinition();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LITERAL_function:
+ case LITERAL_var:
+ case LITERAL_const:
+ case LITERAL_public:
+ case LITERAL_private:
+ case LITERAL_protected:
+ case LITERAL_internal:
+ case LITERAL_static:
+ case LITERAL_final:
+ case LITERAL_enumerable:
+ case LITERAL_explicit:
+ case LITERAL_override:
+ case LITERAL_dynamic:
+ {
+ modifiers();
+ if (0 == inputState.guessing)
+ {
+ m_AST = (AST)returnAST;
+ }
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_var:
+ case LITERAL_const:
+ {
+ variableDefinition(m_AST);
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LITERAL_function:
+ {
+ methodDefinition(m_AST);
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ break;
+ }
+ case SEMI:
+ {
+ match(SEMI);
+ break;
+ }
+ default:
+ {
+ goto _loop28_breakloop;
+ }
+ }
+ }
+_loop28_breakloop: ;
+ } // ( ... )*
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ match(RCURLY);
+ if (0==inputState.guessing)
+ {
+ typeBlock_AST = (AST)currentAST.root;
+ typeBlock_AST = (AST) astFactory.make(astFactory.create(TYPE_BLOCK,"TYPE_BLOCK"), typeBlock_AST);
+ setRegionInfo(typeBlock_AST,s_AST,e_AST);
+ currentAST.root = typeBlock_AST;
+ if ( (null != typeBlock_AST) && (null != typeBlock_AST.getFirstChild()) )
+ currentAST.child = typeBlock_AST.getFirstChild();
+ else
+ currentAST.child = typeBlock_AST;
+ currentAST.advanceChildToEnd();
+ }
+ typeBlock_AST = currentAST.root;
+ returnAST = typeBlock_AST;
+ }
+
+ public void parameterDeclarationList() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST parameterDeclarationList_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LPAREN);
- {
- switch ( LA(1) )
- {
- case IDENT:
- case LITERAL_const:
- case REST:
- {
- {
- switch ( LA(1) )
- {
- case IDENT:
- case LITERAL_const:
- {
- parameterDeclaration();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case REST:
- {
- parameterRestDeclaration();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==COMMA))
- {
- match(COMMA);
- {
- switch ( LA(1) )
- {
- case IDENT:
- case LITERAL_const:
- {
- parameterDeclaration();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case REST:
- {
- parameterRestDeclaration();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- }
- else
- {
- goto _loop50_breakloop;
- }
-
- }
-_loop50_breakloop: ;
- } // ( ... )*
- break;
- }
- case RPAREN:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- e = LT(1);
- e_AST = astFactory.create(e);
- match(RPAREN);
- if (0==inputState.guessing)
- {
- parameterDeclarationList_AST = (AST)currentAST.root;
- parameterDeclarationList_AST = (AST) astFactory.make(astFactory.create(PARAMS,"PARAMS"), parameterDeclarationList_AST);
- setRegionInfo(parameterDeclarationList_AST,s_AST,e_AST);
- currentAST.root = parameterDeclarationList_AST;
- if ( (null != parameterDeclarationList_AST) && (null != parameterDeclarationList_AST.getFirstChild()) )
- currentAST.child = parameterDeclarationList_AST.getFirstChild();
- else
- currentAST.child = parameterDeclarationList_AST;
- currentAST.advanceChildToEnd();
- }
- parameterDeclarationList_AST = currentAST.root;
- returnAST = parameterDeclarationList_AST;
- }
-
- public void typeExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST parameterDeclarationList_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LPAREN);
+ {
+ switch ( LA(1) )
+ {
+ case IDENT:
+ case LITERAL_const:
+ case REST:
+ {
+ {
+ switch ( LA(1) )
+ {
+ case IDENT:
+ case LITERAL_const:
+ {
+ parameterDeclaration();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case REST:
+ {
+ parameterRestDeclaration();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==COMMA))
+ {
+ match(COMMA);
+ {
+ switch ( LA(1) )
+ {
+ case IDENT:
+ case LITERAL_const:
+ {
+ parameterDeclaration();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case REST:
+ {
+ parameterRestDeclaration();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else
+ {
+ goto _loop50_breakloop;
+ }
+
+ }
+_loop50_breakloop: ;
+ } // ( ... )*
+ break;
+ }
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ match(RPAREN);
+ if (0==inputState.guessing)
+ {
+ parameterDeclarationList_AST = (AST)currentAST.root;
+ parameterDeclarationList_AST = (AST) astFactory.make(astFactory.create(PARAMS,"PARAMS"), parameterDeclarationList_AST);
+ setRegionInfo(parameterDeclarationList_AST,s_AST,e_AST);
+ currentAST.root = parameterDeclarationList_AST;
+ if ( (null != parameterDeclarationList_AST) && (null != parameterDeclarationList_AST.getFirstChild()) )
+ currentAST.child = parameterDeclarationList_AST.getFirstChild();
+ else
+ currentAST.child = parameterDeclarationList_AST;
+ currentAST.advanceChildToEnd();
+ }
+ parameterDeclarationList_AST = currentAST.root;
+ returnAST = parameterDeclarationList_AST;
+ }
+
+ public void typeExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST typeExpression_AST = null;
-
- {
- switch ( LA(1) )
- {
- case COLON:
- {
- match(COLON);
- identifier();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- typeExpression_AST = (AST)currentAST.root;
- typeExpression_AST = (AST) astFactory.make(astFactory.create(TYPE_SPEC,"TYPE_SPEC"), typeExpression_AST);
- currentAST.root = typeExpression_AST;
- if ( (null != typeExpression_AST) && (null != typeExpression_AST.getFirstChild()) )
- currentAST.child = typeExpression_AST.getFirstChild();
- else
- currentAST.child = typeExpression_AST;
- currentAST.advanceChildToEnd();
- }
- break;
- }
- case LCURLY:
- case SEMI:
- case RCURLY:
- case LITERAL_import:
- case LBRACK:
- case COMMA:
- case LPAREN:
- case RPAREN:
- case LITERAL_class:
- case LITERAL_interface:
- case LITERAL_function:
- case IDENT:
- case LITERAL_namespace:
- case LITERAL_var:
- case LITERAL_const:
- case ASSIGN:
- case LITERAL_while:
- case LITERAL_do:
- case LITERAL_with:
- case LITERAL_if:
- case LITERAL_else:
- case LITERAL_throw:
- case LITERAL_return:
- case LITERAL_continue:
- case LITERAL_break:
- case LITERAL_switch:
- case LITERAL_case:
- case LITERAL_default:
- case LITERAL_for:
- case LITERAL_in:
- case LITERAL_public:
- case LITERAL_private:
- case LITERAL_protected:
- case LITERAL_internal:
- case LITERAL_static:
- case LITERAL_final:
- case LITERAL_enumerable:
- case LITERAL_explicit:
- case LITERAL_override:
- case LITERAL_dynamic:
- case NUMBER:
- case PLUS:
- case MINUS:
- case INC:
- case DEC:
- case LITERAL_delete:
- case LITERAL_typeof:
- case LNOT:
- case BNOT:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- typeExpression_AST = currentAST.root;
- returnAST = typeExpression_AST;
- }
-
- public void block() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST typeExpression_AST = null;
+
+ {
+ switch ( LA(1) )
+ {
+ case COLON:
+ {
+ match(COLON);
+ identifier();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ typeExpression_AST = (AST)currentAST.root;
+ typeExpression_AST = (AST) astFactory.make(astFactory.create(TYPE_SPEC,"TYPE_SPEC"), typeExpression_AST);
+ currentAST.root = typeExpression_AST;
+ if ( (null != typeExpression_AST) && (null != typeExpression_AST.getFirstChild()) )
+ currentAST.child = typeExpression_AST.getFirstChild();
+ else
+ currentAST.child = typeExpression_AST;
+ currentAST.advanceChildToEnd();
+ }
+ break;
+ }
+ case LCURLY:
+ case SEMI:
+ case RCURLY:
+ case LITERAL_import:
+ case LBRACK:
+ case COMMA:
+ case LPAREN:
+ case RPAREN:
+ case LITERAL_class:
+ case LITERAL_interface:
+ case LITERAL_function:
+ case IDENT:
+ case LITERAL_namespace:
+ case LITERAL_var:
+ case LITERAL_const:
+ case ASSIGN:
+ case LITERAL_while:
+ case LITERAL_do:
+ case LITERAL_with:
+ case LITERAL_if:
+ case LITERAL_else:
+ case LITERAL_throw:
+ case LITERAL_return:
+ case LITERAL_continue:
+ case LITERAL_break:
+ case LITERAL_switch:
+ case LITERAL_case:
+ case LITERAL_default:
+ case LITERAL_for:
+ case LITERAL_in:
+ case LITERAL_public:
+ case LITERAL_private:
+ case LITERAL_protected:
+ case LITERAL_internal:
+ case LITERAL_static:
+ case LITERAL_final:
+ case LITERAL_enumerable:
+ case LITERAL_explicit:
+ case LITERAL_override:
+ case LITERAL_dynamic:
+ case NUMBER:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case LITERAL_delete:
+ case LITERAL_typeof:
+ case LNOT:
+ case BNOT:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ typeExpression_AST = currentAST.root;
+ returnAST = typeExpression_AST;
+ }
+
+ public void block() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST block_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LCURLY);
- { // ( ... )*
- for (;;)
- {
- if ((tokenSet_1_.member(LA(1))))
- {
- statement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop58_breakloop;
- }
-
- }
-_loop58_breakloop: ;
- } // ( ... )*
- e = LT(1);
- e_AST = astFactory.create(e);
- match(RCURLY);
- if (0==inputState.guessing)
- {
- block_AST = (AST)currentAST.root;
- block_AST = (AST) astFactory.make(astFactory.create(BLOCK,"BLOCK"), block_AST);
- setRegionInfo(block_AST,s_AST,e_AST);
- currentAST.root = block_AST;
- if ( (null != block_AST) && (null != block_AST.getFirstChild()) )
- currentAST.child = block_AST.getFirstChild();
- else
- currentAST.child = block_AST;
- currentAST.advanceChildToEnd();
- }
- block_AST = currentAST.root;
- returnAST = block_AST;
- }
-
- public void variableDeclarator(
- AST mods
- ) //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST block_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LCURLY);
+ { // ( ... )*
+ for (;;)
+ {
+ if ((tokenSet_1_.member(LA(1))))
+ {
+ statement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop58_breakloop;
+ }
+
+ }
+_loop58_breakloop: ;
+ } // ( ... )*
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ match(RCURLY);
+ if (0==inputState.guessing)
+ {
+ block_AST = (AST)currentAST.root;
+ block_AST = (AST) astFactory.make(astFactory.create(BLOCK,"BLOCK"), block_AST);
+ setRegionInfo(block_AST,s_AST,e_AST);
+ currentAST.root = block_AST;
+ if ( (null != block_AST) && (null != block_AST.getFirstChild()) )
+ currentAST.child = block_AST.getFirstChild();
+ else
+ currentAST.child = block_AST;
+ currentAST.advanceChildToEnd();
+ }
+ block_AST = currentAST.root;
+ returnAST = block_AST;
+ }
+
+ public void variableDeclarator(
+ AST mods
+ ) //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST variableDeclarator_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e1_AST = null;
- AST e2_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.addASTChild(ref currentAST, s_AST);
- match(IDENT);
- typeExpression();
- if (0 == inputState.guessing)
- {
- e1_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- {
- switch ( LA(1) )
- {
- case ASSIGN:
- {
- variableInitializer();
- if (0 == inputState.guessing)
- {
- e2_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LCURLY:
- case SEMI:
- case RCURLY:
- case LITERAL_import:
- case LBRACK:
- case COMMA:
- case LPAREN:
- case LITERAL_class:
- case LITERAL_interface:
- case LITERAL_function:
- case IDENT:
- case LITERAL_namespace:
- case LITERAL_var:
- case LITERAL_const:
- case LITERAL_while:
- case LITERAL_do:
- case LITERAL_with:
- case LITERAL_if:
- case LITERAL_else:
- case LITERAL_throw:
- case LITERAL_return:
- case LITERAL_continue:
- case LITERAL_break:
- case LITERAL_switch:
- case LITERAL_case:
- case LITERAL_default:
- case LITERAL_for:
- case LITERAL_in:
- case LITERAL_public:
- case LITERAL_private:
- case LITERAL_protected:
- case LITERAL_internal:
- case LITERAL_static:
- case LITERAL_final:
- case LITERAL_enumerable:
- case LITERAL_explicit:
- case LITERAL_override:
- case LITERAL_dynamic:
- case NUMBER:
- case PLUS:
- case MINUS:
- case INC:
- case DEC:
- case LITERAL_delete:
- case LITERAL_typeof:
- case LNOT:
- case BNOT:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- if (0==inputState.guessing)
- {
- variableDeclarator_AST = (AST)currentAST.root;
- variableDeclarator_AST = (AST) astFactory.make(astFactory.create(VARIABLE_DEF,"VARIABLE_DEF"), variableDeclarator_AST, mods);
- setRegionInfo(variableDeclarator_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
- currentAST.root = variableDeclarator_AST;
- if ( (null != variableDeclarator_AST) && (null != variableDeclarator_AST.getFirstChild()) )
- currentAST.child = variableDeclarator_AST.getFirstChild();
- else
- currentAST.child = variableDeclarator_AST;
- currentAST.advanceChildToEnd();
- }
- variableDeclarator_AST = currentAST.root;
- returnAST = variableDeclarator_AST;
- }
-
- public void variableInitializer() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST variableDeclarator_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e1_AST = null;
+ AST e2_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.addASTChild(ref currentAST, s_AST);
+ match(IDENT);
+ typeExpression();
+ if (0 == inputState.guessing)
+ {
+ e1_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ {
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ variableInitializer();
+ if (0 == inputState.guessing)
+ {
+ e2_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LCURLY:
+ case SEMI:
+ case RCURLY:
+ case LITERAL_import:
+ case LBRACK:
+ case COMMA:
+ case LPAREN:
+ case LITERAL_class:
+ case LITERAL_interface:
+ case LITERAL_function:
+ case IDENT:
+ case LITERAL_namespace:
+ case LITERAL_var:
+ case LITERAL_const:
+ case LITERAL_while:
+ case LITERAL_do:
+ case LITERAL_with:
+ case LITERAL_if:
+ case LITERAL_else:
+ case LITERAL_throw:
+ case LITERAL_return:
+ case LITERAL_continue:
+ case LITERAL_break:
+ case LITERAL_switch:
+ case LITERAL_case:
+ case LITERAL_default:
+ case LITERAL_for:
+ case LITERAL_in:
+ case LITERAL_public:
+ case LITERAL_private:
+ case LITERAL_protected:
+ case LITERAL_internal:
+ case LITERAL_static:
+ case LITERAL_final:
+ case LITERAL_enumerable:
+ case LITERAL_explicit:
+ case LITERAL_override:
+ case LITERAL_dynamic:
+ case NUMBER:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case LITERAL_delete:
+ case LITERAL_typeof:
+ case LNOT:
+ case BNOT:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if (0==inputState.guessing)
+ {
+ variableDeclarator_AST = (AST)currentAST.root;
+ variableDeclarator_AST = (AST) astFactory.make(astFactory.create(VARIABLE_DEF,"VARIABLE_DEF"), variableDeclarator_AST, mods);
+ setRegionInfo(variableDeclarator_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
+ currentAST.root = variableDeclarator_AST;
+ if ( (null != variableDeclarator_AST) && (null != variableDeclarator_AST.getFirstChild()) )
+ currentAST.child = variableDeclarator_AST.getFirstChild();
+ else
+ currentAST.child = variableDeclarator_AST;
+ currentAST.advanceChildToEnd();
+ }
+ variableDeclarator_AST = currentAST.root;
+ returnAST = variableDeclarator_AST;
+ }
+
+ public void variableInitializer() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST variableInitializer_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(ASSIGN);
- expression();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- variableInitializer_AST = (AST)currentAST.root;
- setRegionInfo(variableInitializer_AST,s_AST,e_AST);
- }
- variableInitializer_AST = currentAST.root;
- returnAST = variableInitializer_AST;
- }
-
- public void declaration() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST variableInitializer_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(ASSIGN);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ variableInitializer_AST = (AST)currentAST.root;
+ setRegionInfo(variableInitializer_AST,s_AST,e_AST);
+ }
+ variableInitializer_AST = currentAST.root;
+ returnAST = variableInitializer_AST;
+ }
+
+ public void declaration() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST declaration_AST = null;
-
- match(LITERAL_var);
- variableDeclarator(null);
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==COMMA))
- {
- match(COMMA);
- variableDeclarator(null);
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop43_breakloop;
- }
-
- }
-_loop43_breakloop: ;
- } // ( ... )*
- declaration_AST = currentAST.root;
- returnAST = declaration_AST;
- }
-
- public void parameterDeclaration() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST declaration_AST = null;
+
+ match(LITERAL_var);
+ variableDeclarator(null);
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==COMMA))
+ {
+ match(COMMA);
+ variableDeclarator(null);
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop43_breakloop;
+ }
+
+ }
+_loop43_breakloop: ;
+ } // ( ... )*
+ declaration_AST = currentAST.root;
+ returnAST = declaration_AST;
+ }
+
+ public void parameterDeclaration() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST parameterDeclaration_AST = null;
-
- {
- switch ( LA(1) )
- {
- case LITERAL_const:
- {
- AST tmp28_AST = null;
- tmp28_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp28_AST);
- match(LITERAL_const);
- break;
- }
- case IDENT:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- AST tmp29_AST = null;
- tmp29_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp29_AST);
- match(IDENT);
- typeExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- {
- switch ( LA(1) )
- {
- case ASSIGN:
- {
- AST tmp30_AST = null;
- tmp30_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp30_AST);
- match(ASSIGN);
- assignmentExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case COMMA:
- case RPAREN:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- if (0==inputState.guessing)
- {
- parameterDeclaration_AST = (AST)currentAST.root;
- parameterDeclaration_AST = (AST) astFactory.make(astFactory.create(PARAM,"PARAM"), parameterDeclaration_AST);
- currentAST.root = parameterDeclaration_AST;
- if ( (null != parameterDeclaration_AST) && (null != parameterDeclaration_AST.getFirstChild()) )
- currentAST.child = parameterDeclaration_AST.getFirstChild();
- else
- currentAST.child = parameterDeclaration_AST;
- currentAST.advanceChildToEnd();
- }
- parameterDeclaration_AST = currentAST.root;
- returnAST = parameterDeclaration_AST;
- }
-
- public void parameterRestDeclaration() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST parameterDeclaration_AST = null;
+
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_const:
+ {
+ AST tmp28_AST = null;
+ tmp28_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp28_AST);
+ match(LITERAL_const);
+ break;
+ }
+ case IDENT:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ AST tmp29_AST = null;
+ tmp29_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp29_AST);
+ match(IDENT);
+ typeExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ {
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ AST tmp30_AST = null;
+ tmp30_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp30_AST);
+ match(ASSIGN);
+ assignmentExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case COMMA:
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if (0==inputState.guessing)
+ {
+ parameterDeclaration_AST = (AST)currentAST.root;
+ parameterDeclaration_AST = (AST) astFactory.make(astFactory.create(PARAM,"PARAM"), parameterDeclaration_AST);
+ currentAST.root = parameterDeclaration_AST;
+ if ( (null != parameterDeclaration_AST) && (null != parameterDeclaration_AST.getFirstChild()) )
+ currentAST.child = parameterDeclaration_AST.getFirstChild();
+ else
+ currentAST.child = parameterDeclaration_AST;
+ currentAST.advanceChildToEnd();
+ }
+ parameterDeclaration_AST = currentAST.root;
+ returnAST = parameterDeclaration_AST;
+ }
+
+ public void parameterRestDeclaration() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST parameterRestDeclaration_AST = null;
-
- AST tmp31_AST = null;
- tmp31_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp31_AST);
- match(REST);
- {
- switch ( LA(1) )
- {
- case LITERAL_const:
- {
- AST tmp32_AST = null;
- tmp32_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp32_AST);
- match(LITERAL_const);
- break;
- }
- case IDENT:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- AST tmp33_AST = null;
- tmp33_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp33_AST);
- match(IDENT);
- if (0==inputState.guessing)
- {
- parameterRestDeclaration_AST = (AST)currentAST.root;
- parameterRestDeclaration_AST = (AST) astFactory.make(astFactory.create(PARAM,"PARAM"), parameterRestDeclaration_AST);
- currentAST.root = parameterRestDeclaration_AST;
- if ( (null != parameterRestDeclaration_AST) && (null != parameterRestDeclaration_AST.getFirstChild()) )
- currentAST.child = parameterRestDeclaration_AST.getFirstChild();
- else
- currentAST.child = parameterRestDeclaration_AST;
- currentAST.advanceChildToEnd();
- }
- parameterRestDeclaration_AST = currentAST.root;
- returnAST = parameterRestDeclaration_AST;
- }
-
- public void assignmentExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST parameterRestDeclaration_AST = null;
+
+ AST tmp31_AST = null;
+ tmp31_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp31_AST);
+ match(REST);
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_const:
+ {
+ AST tmp32_AST = null;
+ tmp32_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp32_AST);
+ match(LITERAL_const);
+ break;
+ }
+ case IDENT:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ AST tmp33_AST = null;
+ tmp33_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp33_AST);
+ match(IDENT);
+ if (0==inputState.guessing)
+ {
+ parameterRestDeclaration_AST = (AST)currentAST.root;
+ parameterRestDeclaration_AST = (AST) astFactory.make(astFactory.create(PARAM,"PARAM"), parameterRestDeclaration_AST);
+ currentAST.root = parameterRestDeclaration_AST;
+ if ( (null != parameterRestDeclaration_AST) && (null != parameterRestDeclaration_AST.getFirstChild()) )
+ currentAST.child = parameterRestDeclaration_AST.getFirstChild();
+ else
+ currentAST.child = parameterRestDeclaration_AST;
+ currentAST.advanceChildToEnd();
+ }
+ parameterRestDeclaration_AST = currentAST.root;
+ returnAST = parameterRestDeclaration_AST;
+ }
+
+ public void assignmentExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST assignmentExpression_AST = null;
- AST s_AST = null;
- AST e_AST = null;
-
- conditionalExpression();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- {
- bool synPredMatched147 = false;
- if (((tokenSet_2_.member(LA(1))) && (tokenSet_3_.member(LA(2)))))
- {
- int _m147 = mark();
- synPredMatched147 = true;
- inputState.guessing++;
- try {
- {
- {
- switch ( LA(1) )
- {
- case ASSIGN:
- {
- match(ASSIGN);
- break;
- }
- case STAR_ASSIGN:
- {
- match(STAR_ASSIGN);
- break;
- }
- case DIV_ASSIGN:
- {
- match(DIV_ASSIGN);
- break;
- }
- case MOD_ASSIGN:
- {
- match(MOD_ASSIGN);
- break;
- }
- case PLUS_ASSIGN:
- {
- match(PLUS_ASSIGN);
- break;
- }
- case MINUS_ASSIGN:
- {
- match(MINUS_ASSIGN);
- break;
- }
- case SL_ASSIGN:
- {
- match(SL_ASSIGN);
- break;
- }
- case SR_ASSIGN:
- {
- match(SR_ASSIGN);
- break;
- }
- case BSR_ASSIGN:
- {
- match(BSR_ASSIGN);
- break;
- }
- case BAND_ASSIGN:
- {
- match(BAND_ASSIGN);
- break;
- }
- case BXOR_ASSIGN:
- {
- match(BXOR_ASSIGN);
- break;
- }
- case BOR_ASSIGN:
- {
- match(BOR_ASSIGN);
- break;
- }
- case LAND_ASSIGN:
- {
- match(LAND_ASSIGN);
- break;
- }
- case LOR_ASSIGN:
- {
- match(LOR_ASSIGN);
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- matchNot(ASSIGN);
- }
- }
- catch (RecognitionException)
- {
- synPredMatched147 = false;
- }
- rewind(_m147);
- inputState.guessing--;
- }
- if ( synPredMatched147 )
- {
- {
- switch ( LA(1) )
- {
- case ASSIGN:
- {
- AST tmp34_AST = null;
- tmp34_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp34_AST);
- match(ASSIGN);
- break;
- }
- case STAR_ASSIGN:
- {
- AST tmp35_AST = null;
- tmp35_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp35_AST);
- match(STAR_ASSIGN);
- break;
- }
- case DIV_ASSIGN:
- {
- AST tmp36_AST = null;
- tmp36_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp36_AST);
- match(DIV_ASSIGN);
- break;
- }
- case MOD_ASSIGN:
- {
- AST tmp37_AST = null;
- tmp37_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp37_AST);
- match(MOD_ASSIGN);
- break;
- }
- case PLUS_ASSIGN:
- {
- AST tmp38_AST = null;
- tmp38_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp38_AST);
- match(PLUS_ASSIGN);
- break;
- }
- case MINUS_ASSIGN:
- {
- AST tmp39_AST = null;
- tmp39_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp39_AST);
- match(MINUS_ASSIGN);
- break;
- }
- case SL_ASSIGN:
- {
- AST tmp40_AST = null;
- tmp40_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp40_AST);
- match(SL_ASSIGN);
- break;
- }
- case SR_ASSIGN:
- {
- AST tmp41_AST = null;
- tmp41_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp41_AST);
- match(SR_ASSIGN);
- break;
- }
- case BSR_ASSIGN:
- {
- AST tmp42_AST = null;
- tmp42_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp42_AST);
- match(BSR_ASSIGN);
- break;
- }
- case BAND_ASSIGN:
- {
- AST tmp43_AST = null;
- tmp43_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp43_AST);
- match(BAND_ASSIGN);
- break;
- }
- case BXOR_ASSIGN:
- {
- AST tmp44_AST = null;
- tmp44_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp44_AST);
- match(BXOR_ASSIGN);
- break;
- }
- case BOR_ASSIGN:
- {
- AST tmp45_AST = null;
- tmp45_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp45_AST);
- match(BOR_ASSIGN);
- break;
- }
- case LAND_ASSIGN:
- {
- AST tmp46_AST = null;
- tmp46_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp46_AST);
- match(LAND_ASSIGN);
- break;
- }
- case LOR_ASSIGN:
- {
- AST tmp47_AST = null;
- tmp47_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp47_AST);
- match(LOR_ASSIGN);
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- assignmentExpression();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- assignmentExpression_AST = (AST)currentAST.root;
- setRegionInfo(assignmentExpression_AST,s_AST,e_AST);
- }
- }
- else if ((tokenSet_4_.member(LA(1))) && (tokenSet_5_.member(LA(2)))) {
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- assignmentExpression_AST = currentAST.root;
- returnAST = assignmentExpression_AST;
- }
-
- public void statement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST assignmentExpression_AST = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ conditionalExpression();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ {
+ bool synPredMatched147 = false;
+ if (((tokenSet_2_.member(LA(1))) && (tokenSet_3_.member(LA(2)))))
+ {
+ int _m147 = mark();
+ synPredMatched147 = true;
+ inputState.guessing++;
+ try {
+ {
+ {
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ match(ASSIGN);
+ break;
+ }
+ case STAR_ASSIGN:
+ {
+ match(STAR_ASSIGN);
+ break;
+ }
+ case DIV_ASSIGN:
+ {
+ match(DIV_ASSIGN);
+ break;
+ }
+ case MOD_ASSIGN:
+ {
+ match(MOD_ASSIGN);
+ break;
+ }
+ case PLUS_ASSIGN:
+ {
+ match(PLUS_ASSIGN);
+ break;
+ }
+ case MINUS_ASSIGN:
+ {
+ match(MINUS_ASSIGN);
+ break;
+ }
+ case SL_ASSIGN:
+ {
+ match(SL_ASSIGN);
+ break;
+ }
+ case SR_ASSIGN:
+ {
+ match(SR_ASSIGN);
+ break;
+ }
+ case BSR_ASSIGN:
+ {
+ match(BSR_ASSIGN);
+ break;
+ }
+ case BAND_ASSIGN:
+ {
+ match(BAND_ASSIGN);
+ break;
+ }
+ case BXOR_ASSIGN:
+ {
+ match(BXOR_ASSIGN);
+ break;
+ }
+ case BOR_ASSIGN:
+ {
+ match(BOR_ASSIGN);
+ break;
+ }
+ case LAND_ASSIGN:
+ {
+ match(LAND_ASSIGN);
+ break;
+ }
+ case LOR_ASSIGN:
+ {
+ match(LOR_ASSIGN);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ matchNot(ASSIGN);
+ }
+ }
+ catch (RecognitionException)
+ {
+ synPredMatched147 = false;
+ }
+ rewind(_m147);
+ inputState.guessing--;
+ }
+ if ( synPredMatched147 )
+ {
+ {
+ switch ( LA(1) )
+ {
+ case ASSIGN:
+ {
+ AST tmp34_AST = null;
+ tmp34_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp34_AST);
+ match(ASSIGN);
+ break;
+ }
+ case STAR_ASSIGN:
+ {
+ AST tmp35_AST = null;
+ tmp35_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp35_AST);
+ match(STAR_ASSIGN);
+ break;
+ }
+ case DIV_ASSIGN:
+ {
+ AST tmp36_AST = null;
+ tmp36_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp36_AST);
+ match(DIV_ASSIGN);
+ break;
+ }
+ case MOD_ASSIGN:
+ {
+ AST tmp37_AST = null;
+ tmp37_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp37_AST);
+ match(MOD_ASSIGN);
+ break;
+ }
+ case PLUS_ASSIGN:
+ {
+ AST tmp38_AST = null;
+ tmp38_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp38_AST);
+ match(PLUS_ASSIGN);
+ break;
+ }
+ case MINUS_ASSIGN:
+ {
+ AST tmp39_AST = null;
+ tmp39_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp39_AST);
+ match(MINUS_ASSIGN);
+ break;
+ }
+ case SL_ASSIGN:
+ {
+ AST tmp40_AST = null;
+ tmp40_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp40_AST);
+ match(SL_ASSIGN);
+ break;
+ }
+ case SR_ASSIGN:
+ {
+ AST tmp41_AST = null;
+ tmp41_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp41_AST);
+ match(SR_ASSIGN);
+ break;
+ }
+ case BSR_ASSIGN:
+ {
+ AST tmp42_AST = null;
+ tmp42_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp42_AST);
+ match(BSR_ASSIGN);
+ break;
+ }
+ case BAND_ASSIGN:
+ {
+ AST tmp43_AST = null;
+ tmp43_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp43_AST);
+ match(BAND_ASSIGN);
+ break;
+ }
+ case BXOR_ASSIGN:
+ {
+ AST tmp44_AST = null;
+ tmp44_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp44_AST);
+ match(BXOR_ASSIGN);
+ break;
+ }
+ case BOR_ASSIGN:
+ {
+ AST tmp45_AST = null;
+ tmp45_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp45_AST);
+ match(BOR_ASSIGN);
+ break;
+ }
+ case LAND_ASSIGN:
+ {
+ AST tmp46_AST = null;
+ tmp46_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp46_AST);
+ match(LAND_ASSIGN);
+ break;
+ }
+ case LOR_ASSIGN:
+ {
+ AST tmp47_AST = null;
+ tmp47_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp47_AST);
+ match(LOR_ASSIGN);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ assignmentExpression();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ assignmentExpression_AST = (AST)currentAST.root;
+ setRegionInfo(assignmentExpression_AST,s_AST,e_AST);
+ }
+ }
+ else if ((tokenSet_4_.member(LA(1))) && (tokenSet_5_.member(LA(2)))) {
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ assignmentExpression_AST = currentAST.root;
+ returnAST = assignmentExpression_AST;
+ }
+
+ public void statement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST statement_AST = null;
- AST s1_AST = null;
- IToken e1 = null;
- AST e1_AST = null;
- AST s2_AST = null;
- IToken e2 = null;
- AST e2_AST = null;
-
- switch ( LA(1) )
- {
- case LITERAL_var:
- {
- declaration();
- if (0 == inputState.guessing)
- {
- s1_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- {
- if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
- {
- {
- e1 = LT(1);
- e1_AST = astFactory.create(e1);
- match(SEMI);
- }
- }
- else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- if (0==inputState.guessing)
- {
- statement_AST = (AST)currentAST.root;
- setRegionInfo(statement_AST,s1_AST,e1_AST);
- }
- statement_AST = currentAST.root;
- break;
- }
- case LITERAL_if:
- {
- ifStatement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- statement_AST = currentAST.root;
- break;
- }
- case LITERAL_for:
- {
- forStatement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- statement_AST = currentAST.root;
- break;
- }
- case LITERAL_while:
- {
- AST tmp48_AST = null;
- tmp48_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp48_AST);
- match(LITERAL_while);
- match(LPAREN);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- match(RPAREN);
- statement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- statement_AST = currentAST.root;
- break;
- }
- case LITERAL_do:
- {
- AST tmp51_AST = null;
- tmp51_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp51_AST);
- match(LITERAL_do);
- statement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- match(LITERAL_while);
- match(LPAREN);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- match(RPAREN);
- statement_AST = currentAST.root;
- break;
- }
- case LITERAL_with:
- {
- AST tmp55_AST = null;
- tmp55_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp55_AST);
- match(LITERAL_with);
- match(LPAREN);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- match(RPAREN);
- statement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- statement_AST = currentAST.root;
- break;
- }
- case LITERAL_switch:
- {
- switchStatement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- statement_AST = currentAST.root;
- break;
- }
- case LITERAL_break:
- {
- breakStatement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- statement_AST = currentAST.root;
- break;
- }
- case LITERAL_continue:
- {
- continueStatement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- statement_AST = currentAST.root;
- break;
- }
- case LITERAL_return:
- {
- returnStatement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- statement_AST = currentAST.root;
- break;
- }
- case LITERAL_throw:
- {
- throwStatement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- statement_AST = currentAST.root;
- break;
- }
- case SEMI:
- {
- match(SEMI);
- statement_AST = currentAST.root;
- break;
- }
- default:
- if (((LA(1)==LCURLY) && (tokenSet_8_.member(LA(2))))&&(LA(1)==LCURLY))
- {
- {
- block();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- statement_AST = currentAST.root;
- }
- else if ((tokenSet_3_.member(LA(1))) && (tokenSet_9_.member(LA(2)))) {
- assignmentExpression();
- if (0 == inputState.guessing)
- {
- s2_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- {
- if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
- {
- {
- e2 = LT(1);
- e2_AST = astFactory.create(e2);
- match(SEMI);
- }
- }
- else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- if (0==inputState.guessing)
- {
- statement_AST = (AST)currentAST.root;
- statement_AST = (AST) astFactory.make(astFactory.create(EXPR_STMNT,"EXPR_STMNT"), statement_AST);
- setRegionInfo(statement_AST,s2_AST,e2_AST);
- currentAST.root = statement_AST;
- if ( (null != statement_AST) && (null != statement_AST.getFirstChild()) )
- currentAST.child = statement_AST.getFirstChild();
- else
- currentAST.child = statement_AST;
- currentAST.advanceChildToEnd();
- }
- statement_AST = currentAST.root;
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- break; }
- returnAST = statement_AST;
- }
-
- public void ifStatement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST statement_AST = null;
+ AST s1_AST = null;
+ IToken e1 = null;
+ AST e1_AST = null;
+ AST s2_AST = null;
+ IToken e2 = null;
+ AST e2_AST = null;
+
+ switch ( LA(1) )
+ {
+ case LITERAL_var:
+ {
+ declaration();
+ if (0 == inputState.guessing)
+ {
+ s1_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ {
+ if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
+ {
+ {
+ e1 = LT(1);
+ e1_AST = astFactory.create(e1);
+ match(SEMI);
+ }
+ }
+ else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if (0==inputState.guessing)
+ {
+ statement_AST = (AST)currentAST.root;
+ setRegionInfo(statement_AST,s1_AST,e1_AST);
+ }
+ statement_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_if:
+ {
+ ifStatement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ statement_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_for:
+ {
+ forStatement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ statement_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_while:
+ {
+ AST tmp48_AST = null;
+ tmp48_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp48_AST);
+ match(LITERAL_while);
+ match(LPAREN);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ match(RPAREN);
+ statement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ statement_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_do:
+ {
+ AST tmp51_AST = null;
+ tmp51_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp51_AST);
+ match(LITERAL_do);
+ statement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ match(LITERAL_while);
+ match(LPAREN);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ match(RPAREN);
+ statement_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_with:
+ {
+ AST tmp55_AST = null;
+ tmp55_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp55_AST);
+ match(LITERAL_with);
+ match(LPAREN);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ match(RPAREN);
+ statement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ statement_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_switch:
+ {
+ switchStatement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ statement_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_break:
+ {
+ breakStatement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ statement_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_continue:
+ {
+ continueStatement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ statement_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_return:
+ {
+ returnStatement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ statement_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_throw:
+ {
+ throwStatement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ statement_AST = currentAST.root;
+ break;
+ }
+ case SEMI:
+ {
+ match(SEMI);
+ statement_AST = currentAST.root;
+ break;
+ }
+ default:
+ if (((LA(1)==LCURLY) && (tokenSet_8_.member(LA(2))))&&(LA(1)==LCURLY))
+ {
+ {
+ block();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ statement_AST = currentAST.root;
+ }
+ else if ((tokenSet_3_.member(LA(1))) && (tokenSet_9_.member(LA(2)))) {
+ assignmentExpression();
+ if (0 == inputState.guessing)
+ {
+ s2_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ {
+ if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
+ {
+ {
+ e2 = LT(1);
+ e2_AST = astFactory.create(e2);
+ match(SEMI);
+ }
+ }
+ else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if (0==inputState.guessing)
+ {
+ statement_AST = (AST)currentAST.root;
+ statement_AST = (AST) astFactory.make(astFactory.create(EXPR_STMNT,"EXPR_STMNT"), statement_AST);
+ setRegionInfo(statement_AST,s2_AST,e2_AST);
+ currentAST.root = statement_AST;
+ if ( (null != statement_AST) && (null != statement_AST.getFirstChild()) )
+ currentAST.child = statement_AST.getFirstChild();
+ else
+ currentAST.child = statement_AST;
+ currentAST.advanceChildToEnd();
+ }
+ statement_AST = currentAST.root;
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ break; }
+ returnAST = statement_AST;
+ }
+
+ public void ifStatement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST ifStatement_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e1_AST = null;
- AST e2_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(LITERAL_if);
- match(LPAREN);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- match(RPAREN);
- statement();
- if (0 == inputState.guessing)
- {
- e1_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==LITERAL_else) && (tokenSet_1_.member(LA(2))))
- {
- elseStatement();
- if (0 == inputState.guessing)
- {
- e2_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop67_breakloop;
- }
-
- }
-_loop67_breakloop: ;
- } // ( ... )*
- if (0==inputState.guessing)
- {
- ifStatement_AST = (AST)currentAST.root;
- setRegionInfo(ifStatement_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
- }
- ifStatement_AST = currentAST.root;
- returnAST = ifStatement_AST;
- }
-
- public void forStatement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST ifStatement_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e1_AST = null;
+ AST e2_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(LITERAL_if);
+ match(LPAREN);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ match(RPAREN);
+ statement();
+ if (0 == inputState.guessing)
+ {
+ e1_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==LITERAL_else) && (tokenSet_1_.member(LA(2))))
+ {
+ elseStatement();
+ if (0 == inputState.guessing)
+ {
+ e2_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop67_breakloop;
+ }
+
+ }
+_loop67_breakloop: ;
+ } // ( ... )*
+ if (0==inputState.guessing)
+ {
+ ifStatement_AST = (AST)currentAST.root;
+ setRegionInfo(ifStatement_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
+ }
+ ifStatement_AST = currentAST.root;
+ returnAST = ifStatement_AST;
+ }
+
+ public void forStatement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST forStatement_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(LITERAL_for);
- {
- bool synPredMatched96 = false;
- if (((LA(1)==LPAREN) && (tokenSet_10_.member(LA(2)))))
- {
- int _m96 = mark();
- synPredMatched96 = true;
- inputState.guessing++;
- try {
- {
- match(LPAREN);
- forInit();
- match(SEMI);
- }
- }
- catch (RecognitionException)
- {
- synPredMatched96 = false;
- }
- rewind(_m96);
- inputState.guessing--;
- }
- if ( synPredMatched96 )
- {
- traditionalForClause();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else if ((LA(1)==LITERAL_each)) {
- {
- AST tmp61_AST = null;
- tmp61_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp61_AST);
- match(LITERAL_each);
- forInClause();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- }
- else if ((LA(1)==LPAREN) && (LA(2)==LITERAL_var)) {
- forInClause();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- statement();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- forStatement_AST = (AST)currentAST.root;
- setRegionInfo(forStatement_AST,s_AST,e_AST);
- }
- forStatement_AST = currentAST.root;
- returnAST = forStatement_AST;
- }
-
- public void switchStatement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST forStatement_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(LITERAL_for);
+ {
+ bool synPredMatched96 = false;
+ if (((LA(1)==LPAREN) && (tokenSet_10_.member(LA(2)))))
+ {
+ int _m96 = mark();
+ synPredMatched96 = true;
+ inputState.guessing++;
+ try {
+ {
+ match(LPAREN);
+ forInit();
+ match(SEMI);
+ }
+ }
+ catch (RecognitionException)
+ {
+ synPredMatched96 = false;
+ }
+ rewind(_m96);
+ inputState.guessing--;
+ }
+ if ( synPredMatched96 )
+ {
+ traditionalForClause();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else if ((LA(1)==LITERAL_each)) {
+ {
+ AST tmp61_AST = null;
+ tmp61_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp61_AST);
+ match(LITERAL_each);
+ forInClause();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ }
+ else if ((LA(1)==LPAREN) && (LA(2)==LITERAL_var)) {
+ forInClause();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ statement();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ forStatement_AST = (AST)currentAST.root;
+ setRegionInfo(forStatement_AST,s_AST,e_AST);
+ }
+ forStatement_AST = currentAST.root;
+ returnAST = forStatement_AST;
+ }
+
+ public void switchStatement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST switchStatement_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(LITERAL_switch);
- match(LPAREN);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- match(RPAREN);
- switchBlock();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- switchStatement_AST = (AST)currentAST.root;
- setRegionInfo(switchStatement_AST,s_AST,e_AST);
- }
- switchStatement_AST = currentAST.root;
- returnAST = switchStatement_AST;
- }
-
- public void breakStatement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST switchStatement_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(LITERAL_switch);
+ match(LPAREN);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ match(RPAREN);
+ switchBlock();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ switchStatement_AST = (AST)currentAST.root;
+ setRegionInfo(switchStatement_AST,s_AST,e_AST);
+ }
+ switchStatement_AST = currentAST.root;
+ returnAST = switchStatement_AST;
+ }
+
+ public void breakStatement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST breakStatement_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(LITERAL_break);
- {
- if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
- {
- {
- e = LT(1);
- e_AST = astFactory.create(e);
- match(SEMI);
- }
- }
- else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- if (0==inputState.guessing)
- {
- breakStatement_AST = (AST)currentAST.root;
- setRegionInfo(breakStatement_AST,s_AST,e_AST);
- }
- breakStatement_AST = currentAST.root;
- returnAST = breakStatement_AST;
- }
-
- public void continueStatement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST breakStatement_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(LITERAL_break);
+ {
+ if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
+ {
+ {
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ match(SEMI);
+ }
+ }
+ else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if (0==inputState.guessing)
+ {
+ breakStatement_AST = (AST)currentAST.root;
+ setRegionInfo(breakStatement_AST,s_AST,e_AST);
+ }
+ breakStatement_AST = currentAST.root;
+ returnAST = breakStatement_AST;
+ }
+
+ public void continueStatement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST continueStatement_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(LITERAL_continue);
- {
- if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
- {
- {
- e = LT(1);
- e_AST = astFactory.create(e);
- match(SEMI);
- }
- }
- else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- if (0==inputState.guessing)
- {
- continueStatement_AST = (AST)currentAST.root;
- setRegionInfo(continueStatement_AST,s_AST,e_AST);
- }
- continueStatement_AST = currentAST.root;
- returnAST = continueStatement_AST;
- }
-
- public void returnStatement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST continueStatement_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(LITERAL_continue);
+ {
+ if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
+ {
+ {
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ match(SEMI);
+ }
+ }
+ else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if (0==inputState.guessing)
+ {
+ continueStatement_AST = (AST)currentAST.root;
+ setRegionInfo(continueStatement_AST,s_AST,e_AST);
+ }
+ continueStatement_AST = currentAST.root;
+ returnAST = continueStatement_AST;
+ }
+
+ public void returnStatement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST returnStatement_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e1_AST = null;
- IToken e2 = null;
- AST e2_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(LITERAL_return);
- {
- if ((tokenSet_3_.member(LA(1))) && (tokenSet_9_.member(LA(2))))
- {
- expression();
- if (0 == inputState.guessing)
- {
- e1_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- {
- if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
- {
- {
- e2 = LT(1);
- e2_AST = astFactory.create(e2);
- match(SEMI);
- }
- }
- else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- if (0==inputState.guessing)
- {
- returnStatement_AST = (AST)currentAST.root;
- setRegionInfo(returnStatement_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
- }
- returnStatement_AST = currentAST.root;
- returnAST = returnStatement_AST;
- }
-
- public void throwStatement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST returnStatement_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e1_AST = null;
+ IToken e2 = null;
+ AST e2_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(LITERAL_return);
+ {
+ if ((tokenSet_3_.member(LA(1))) && (tokenSet_9_.member(LA(2))))
+ {
+ expression();
+ if (0 == inputState.guessing)
+ {
+ e1_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ {
+ if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
+ {
+ {
+ e2 = LT(1);
+ e2_AST = astFactory.create(e2);
+ match(SEMI);
+ }
+ }
+ else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if (0==inputState.guessing)
+ {
+ returnStatement_AST = (AST)currentAST.root;
+ setRegionInfo(returnStatement_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
+ }
+ returnStatement_AST = currentAST.root;
+ returnAST = returnStatement_AST;
+ }
+
+ public void throwStatement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST throwStatement_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e1_AST = null;
- IToken e2 = null;
- AST e2_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(LITERAL_throw);
- expression();
- if (0 == inputState.guessing)
- {
- e1_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- {
- if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
- {
- {
- e2 = LT(1);
- e2_AST = astFactory.create(e2);
- match(SEMI);
- }
- }
- else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- if (0==inputState.guessing)
- {
- throwStatement_AST = (AST)currentAST.root;
- setRegionInfo(throwStatement_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
- }
- throwStatement_AST = currentAST.root;
- returnAST = throwStatement_AST;
- }
-
- public void elseStatement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST throwStatement_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e1_AST = null;
+ IToken e2 = null;
+ AST e2_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(LITERAL_throw);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ e1_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ {
+ if (((LA(1)==SEMI) && (tokenSet_6_.member(LA(2))))&&(LA(1)==SEMI))
+ {
+ {
+ e2 = LT(1);
+ e2_AST = astFactory.create(e2);
+ match(SEMI);
+ }
+ }
+ else if ((tokenSet_6_.member(LA(1))) && (tokenSet_7_.member(LA(2)))) {
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ if (0==inputState.guessing)
+ {
+ throwStatement_AST = (AST)currentAST.root;
+ setRegionInfo(throwStatement_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
+ }
+ throwStatement_AST = currentAST.root;
+ returnAST = throwStatement_AST;
+ }
+
+ public void elseStatement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST elseStatement_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(LITERAL_else);
- statement();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- elseStatement_AST = (AST)currentAST.root;
- setRegionInfo(elseStatement_AST,s_AST,e_AST);
- }
- elseStatement_AST = currentAST.root;
- returnAST = elseStatement_AST;
- }
-
- public void switchBlock() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST elseStatement_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(LITERAL_else);
+ statement();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ elseStatement_AST = (AST)currentAST.root;
+ setRegionInfo(elseStatement_AST,s_AST,e_AST);
+ }
+ elseStatement_AST = currentAST.root;
+ returnAST = elseStatement_AST;
+ }
+
+ public void switchBlock() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST switchBlock_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LCURLY);
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==LITERAL_case))
- {
- caseStatement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop85_breakloop;
- }
-
- }
-_loop85_breakloop: ;
- } // ( ... )*
- {
- switch ( LA(1) )
- {
- case LITERAL_default:
- {
- defaultStatement();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case RCURLY:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- e = LT(1);
- e_AST = astFactory.create(e);
- match(RCURLY);
- if (0==inputState.guessing)
- {
- switchBlock_AST = (AST)currentAST.root;
- switchBlock_AST = (AST) astFactory.make(astFactory.create(BLOCK,"BLOCK"), switchBlock_AST);
- setRegionInfo(switchBlock_AST,s_AST,e_AST);
- currentAST.root = switchBlock_AST;
- if ( (null != switchBlock_AST) && (null != switchBlock_AST.getFirstChild()) )
- currentAST.child = switchBlock_AST.getFirstChild();
- else
- currentAST.child = switchBlock_AST;
- currentAST.advanceChildToEnd();
- }
- switchBlock_AST = currentAST.root;
- returnAST = switchBlock_AST;
- }
-
- public void caseStatement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST switchBlock_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LCURLY);
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==LITERAL_case))
+ {
+ caseStatement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop85_breakloop;
+ }
+
+ }
+_loop85_breakloop: ;
+ } // ( ... )*
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_default:
+ {
+ defaultStatement();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case RCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ match(RCURLY);
+ if (0==inputState.guessing)
+ {
+ switchBlock_AST = (AST)currentAST.root;
+ switchBlock_AST = (AST) astFactory.make(astFactory.create(BLOCK,"BLOCK"), switchBlock_AST);
+ setRegionInfo(switchBlock_AST,s_AST,e_AST);
+ currentAST.root = switchBlock_AST;
+ if ( (null != switchBlock_AST) && (null != switchBlock_AST.getFirstChild()) )
+ currentAST.child = switchBlock_AST.getFirstChild();
+ else
+ currentAST.child = switchBlock_AST;
+ currentAST.advanceChildToEnd();
+ }
+ switchBlock_AST = currentAST.root;
+ returnAST = switchBlock_AST;
+ }
+
+ public void caseStatement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST caseStatement_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e1 = null;
- AST e1_AST = null;
- AST e2_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(LITERAL_case);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- e1 = LT(1);
- e1_AST = astFactory.create(e1);
- match(COLON);
- { // ( ... )*
- for (;;)
- {
- if ((tokenSet_1_.member(LA(1))))
- {
- statement();
- if (0 == inputState.guessing)
- {
- e2_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop89_breakloop;
- }
-
- }
-_loop89_breakloop: ;
- } // ( ... )*
- if (0==inputState.guessing)
- {
- caseStatement_AST = (AST)currentAST.root;
- setRegionInfo(caseStatement_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
- }
- caseStatement_AST = currentAST.root;
- returnAST = caseStatement_AST;
- }
-
- public void defaultStatement() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST caseStatement_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e1 = null;
+ AST e1_AST = null;
+ AST e2_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(LITERAL_case);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ e1 = LT(1);
+ e1_AST = astFactory.create(e1);
+ match(COLON);
+ { // ( ... )*
+ for (;;)
+ {
+ if ((tokenSet_1_.member(LA(1))))
+ {
+ statement();
+ if (0 == inputState.guessing)
+ {
+ e2_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop89_breakloop;
+ }
+
+ }
+_loop89_breakloop: ;
+ } // ( ... )*
+ if (0==inputState.guessing)
+ {
+ caseStatement_AST = (AST)currentAST.root;
+ setRegionInfo(caseStatement_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
+ }
+ caseStatement_AST = currentAST.root;
+ returnAST = caseStatement_AST;
+ }
+
+ public void defaultStatement() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST defaultStatement_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e1 = null;
- AST e1_AST = null;
- AST e2_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.makeASTRoot(ref currentAST, s_AST);
- match(LITERAL_default);
- e1 = LT(1);
- e1_AST = astFactory.create(e1);
- match(COLON);
- { // ( ... )*
- for (;;)
- {
- if ((tokenSet_1_.member(LA(1))))
- {
- statement();
- if (0 == inputState.guessing)
- {
- e2_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop92_breakloop;
- }
-
- }
-_loop92_breakloop: ;
- } // ( ... )*
- if (0==inputState.guessing)
- {
- defaultStatement_AST = (AST)currentAST.root;
- setRegionInfo(defaultStatement_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
- }
- defaultStatement_AST = currentAST.root;
- returnAST = defaultStatement_AST;
- }
-
- public void forInit() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST defaultStatement_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e1 = null;
+ AST e1_AST = null;
+ AST e2_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.makeASTRoot(ref currentAST, s_AST);
+ match(LITERAL_default);
+ e1 = LT(1);
+ e1_AST = astFactory.create(e1);
+ match(COLON);
+ { // ( ... )*
+ for (;;)
+ {
+ if ((tokenSet_1_.member(LA(1))))
+ {
+ statement();
+ if (0 == inputState.guessing)
+ {
+ e2_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop92_breakloop;
+ }
+
+ }
+_loop92_breakloop: ;
+ } // ( ... )*
+ if (0==inputState.guessing)
+ {
+ defaultStatement_AST = (AST)currentAST.root;
+ setRegionInfo(defaultStatement_AST,s_AST,e2_AST==null?e1_AST:e2_AST);
+ }
+ defaultStatement_AST = currentAST.root;
+ returnAST = defaultStatement_AST;
+ }
+
+ public void forInit() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST forInit_AST = null;
- AST s1_AST = null;
- AST s2_AST = null;
-
- {
- switch ( LA(1) )
- {
- case LITERAL_var:
- {
- declaration();
- if (0 == inputState.guessing)
- {
- s1_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case LCURLY:
- case LBRACK:
- case LPAREN:
- case LITERAL_function:
- case IDENT:
- case NUMBER:
- case PLUS:
- case MINUS:
- case INC:
- case DEC:
- case LITERAL_delete:
- case LITERAL_typeof:
- case LNOT:
- case BNOT:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- expressionList();
- if (0 == inputState.guessing)
- {
- s2_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case SEMI:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- if (0==inputState.guessing)
- {
- forInit_AST = (AST)currentAST.root;
- forInit_AST = (AST) astFactory.make(astFactory.create(FOR_INIT,"FOR_INIT"), forInit_AST);
- setRegionInfo(forInit_AST,s2_AST==null?s1_AST:s2_AST,null);
- currentAST.root = forInit_AST;
- if ( (null != forInit_AST) && (null != forInit_AST.getFirstChild()) )
- currentAST.child = forInit_AST.getFirstChild();
- else
- currentAST.child = forInit_AST;
- currentAST.advanceChildToEnd();
- }
- forInit_AST = currentAST.root;
- returnAST = forInit_AST;
- }
-
- public void traditionalForClause() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST forInit_AST = null;
+ AST s1_AST = null;
+ AST s2_AST = null;
+
+ {
+ switch ( LA(1) )
+ {
+ case LITERAL_var:
+ {
+ declaration();
+ if (0 == inputState.guessing)
+ {
+ s1_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case LCURLY:
+ case LBRACK:
+ case LPAREN:
+ case LITERAL_function:
+ case IDENT:
+ case NUMBER:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case LITERAL_delete:
+ case LITERAL_typeof:
+ case LNOT:
+ case BNOT:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ expressionList();
+ if (0 == inputState.guessing)
+ {
+ s2_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if (0==inputState.guessing)
+ {
+ forInit_AST = (AST)currentAST.root;
+ forInit_AST = (AST) astFactory.make(astFactory.create(FOR_INIT,"FOR_INIT"), forInit_AST);
+ setRegionInfo(forInit_AST,s2_AST==null?s1_AST:s2_AST,null);
+ currentAST.root = forInit_AST;
+ if ( (null != forInit_AST) && (null != forInit_AST.getFirstChild()) )
+ currentAST.child = forInit_AST.getFirstChild();
+ else
+ currentAST.child = forInit_AST;
+ currentAST.advanceChildToEnd();
+ }
+ forInit_AST = currentAST.root;
+ returnAST = forInit_AST;
+ }
+
+ public void traditionalForClause() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST traditionalForClause_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LPAREN);
- forInit();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- match(SEMI);
- forCond();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- match(SEMI);
- forIter();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- e = LT(1);
- e_AST = astFactory.create(e);
- match(RPAREN);
- if (0==inputState.guessing)
- {
- traditionalForClause_AST = (AST)currentAST.root;
- setRegionInfo(traditionalForClause_AST,s_AST,e_AST);
- }
- traditionalForClause_AST = currentAST.root;
- returnAST = traditionalForClause_AST;
- }
-
- public void forInClause() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST traditionalForClause_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LPAREN);
+ forInit();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ match(SEMI);
+ forCond();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ match(SEMI);
+ forIter();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ match(RPAREN);
+ if (0==inputState.guessing)
+ {
+ traditionalForClause_AST = (AST)currentAST.root;
+ setRegionInfo(traditionalForClause_AST,s_AST,e_AST);
+ }
+ traditionalForClause_AST = currentAST.root;
+ returnAST = traditionalForClause_AST;
+ }
+
+ public void forInClause() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST forInClause_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LPAREN);
- declaration();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- AST tmp66_AST = null;
- tmp66_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp66_AST);
- match(LITERAL_in);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- e = LT(1);
- e_AST = astFactory.create(e);
- match(RPAREN);
- if (0==inputState.guessing)
- {
- forInClause_AST = (AST)currentAST.root;
- setRegionInfo(forInClause_AST,s_AST,e_AST);
- }
- forInClause_AST = currentAST.root;
- returnAST = forInClause_AST;
- }
-
- public void forCond() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST forInClause_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LPAREN);
+ declaration();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ AST tmp66_AST = null;
+ tmp66_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp66_AST);
+ match(LITERAL_in);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ match(RPAREN);
+ if (0==inputState.guessing)
+ {
+ forInClause_AST = (AST)currentAST.root;
+ setRegionInfo(forInClause_AST,s_AST,e_AST);
+ }
+ forInClause_AST = currentAST.root;
+ returnAST = forInClause_AST;
+ }
+
+ public void forCond() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST forCond_AST = null;
- AST s_AST = null;
-
- {
- switch ( LA(1) )
- {
- case LCURLY:
- case LBRACK:
- case LPAREN:
- case LITERAL_function:
- case IDENT:
- case NUMBER:
- case PLUS:
- case MINUS:
- case INC:
- case DEC:
- case LITERAL_delete:
- case LITERAL_typeof:
- case LNOT:
- case BNOT:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- expression();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case SEMI:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- if (0==inputState.guessing)
- {
- forCond_AST = (AST)currentAST.root;
- forCond_AST = (AST) astFactory.make(astFactory.create(FOR_CONDITION,"FOR_CONDITION"), forCond_AST);
- setRegionInfo(forCond_AST,s_AST,null);
- currentAST.root = forCond_AST;
- if ( (null != forCond_AST) && (null != forCond_AST.getFirstChild()) )
- currentAST.child = forCond_AST.getFirstChild();
- else
- currentAST.child = forCond_AST;
- currentAST.advanceChildToEnd();
- }
- forCond_AST = currentAST.root;
- returnAST = forCond_AST;
- }
-
- public void forIter() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST forCond_AST = null;
+ AST s_AST = null;
+
+ {
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ case LBRACK:
+ case LPAREN:
+ case LITERAL_function:
+ case IDENT:
+ case NUMBER:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case LITERAL_delete:
+ case LITERAL_typeof:
+ case LNOT:
+ case BNOT:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ expression();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case SEMI:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if (0==inputState.guessing)
+ {
+ forCond_AST = (AST)currentAST.root;
+ forCond_AST = (AST) astFactory.make(astFactory.create(FOR_CONDITION,"FOR_CONDITION"), forCond_AST);
+ setRegionInfo(forCond_AST,s_AST,null);
+ currentAST.root = forCond_AST;
+ if ( (null != forCond_AST) && (null != forCond_AST.getFirstChild()) )
+ currentAST.child = forCond_AST.getFirstChild();
+ else
+ currentAST.child = forCond_AST;
+ currentAST.advanceChildToEnd();
+ }
+ forCond_AST = currentAST.root;
+ returnAST = forCond_AST;
+ }
+
+ public void forIter() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST forIter_AST = null;
- AST s_AST = null;
-
- {
- switch ( LA(1) )
- {
- case LCURLY:
- case LBRACK:
- case LPAREN:
- case LITERAL_function:
- case IDENT:
- case NUMBER:
- case PLUS:
- case MINUS:
- case INC:
- case DEC:
- case LITERAL_delete:
- case LITERAL_typeof:
- case LNOT:
- case BNOT:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- expressionList();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case RPAREN:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- if (0==inputState.guessing)
- {
- forIter_AST = (AST)currentAST.root;
- forIter_AST = (AST) astFactory.make(astFactory.create(FOR_ITERATOR,"FOR_ITERATOR"), forIter_AST);
- setRegionInfo(forIter_AST,s_AST,null);
- currentAST.root = forIter_AST;
- if ( (null != forIter_AST) && (null != forIter_AST.getFirstChild()) )
- currentAST.child = forIter_AST.getFirstChild();
- else
- currentAST.child = forIter_AST;
- currentAST.advanceChildToEnd();
- }
- forIter_AST = currentAST.root;
- returnAST = forIter_AST;
- }
-
- public void expressionList() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST forIter_AST = null;
+ AST s_AST = null;
+
+ {
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ case LBRACK:
+ case LPAREN:
+ case LITERAL_function:
+ case IDENT:
+ case NUMBER:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case LITERAL_delete:
+ case LITERAL_typeof:
+ case LNOT:
+ case BNOT:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ expressionList();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case RPAREN:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ if (0==inputState.guessing)
+ {
+ forIter_AST = (AST)currentAST.root;
+ forIter_AST = (AST) astFactory.make(astFactory.create(FOR_ITERATOR,"FOR_ITERATOR"), forIter_AST);
+ setRegionInfo(forIter_AST,s_AST,null);
+ currentAST.root = forIter_AST;
+ if ( (null != forIter_AST) && (null != forIter_AST.getFirstChild()) )
+ currentAST.child = forIter_AST.getFirstChild();
+ else
+ currentAST.child = forIter_AST;
+ currentAST.advanceChildToEnd();
+ }
+ forIter_AST = currentAST.root;
+ returnAST = forIter_AST;
+ }
+
+ public void expressionList() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST expressionList_AST = null;
- AST s_AST = null;
- AST e_AST = null;
-
- expression();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==COMMA))
- {
- match(COMMA);
- expression();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop142_breakloop;
- }
-
- }
-_loop142_breakloop: ;
- } // ( ... )*
- if (0==inputState.guessing)
- {
- expressionList_AST = (AST)currentAST.root;
- expressionList_AST = (AST) astFactory.make(astFactory.create(ELIST,"ELIST"), expressionList_AST);
- setRegionInfo(expressionList_AST,s_AST,e_AST);
- currentAST.root = expressionList_AST;
- if ( (null != expressionList_AST) && (null != expressionList_AST.getFirstChild()) )
- currentAST.child = expressionList_AST.getFirstChild();
- else
- currentAST.child = expressionList_AST;
- currentAST.advanceChildToEnd();
- }
- expressionList_AST = currentAST.root;
- returnAST = expressionList_AST;
- }
-
- public void modifier() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST expressionList_AST = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ expression();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==COMMA))
+ {
+ match(COMMA);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop142_breakloop;
+ }
+
+ }
+_loop142_breakloop: ;
+ } // ( ... )*
+ if (0==inputState.guessing)
+ {
+ expressionList_AST = (AST)currentAST.root;
+ expressionList_AST = (AST) astFactory.make(astFactory.create(ELIST,"ELIST"), expressionList_AST);
+ setRegionInfo(expressionList_AST,s_AST,e_AST);
+ currentAST.root = expressionList_AST;
+ if ( (null != expressionList_AST) && (null != expressionList_AST.getFirstChild()) )
+ currentAST.child = expressionList_AST.getFirstChild();
+ else
+ currentAST.child = expressionList_AST;
+ currentAST.advanceChildToEnd();
+ }
+ expressionList_AST = currentAST.root;
+ returnAST = expressionList_AST;
+ }
+
+ public void modifier() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST modifier_AST = null;
-
- switch ( LA(1) )
- {
- case LITERAL_public:
- {
- AST tmp68_AST = null;
- tmp68_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp68_AST);
- match(LITERAL_public);
- modifier_AST = currentAST.root;
- break;
- }
- case LITERAL_private:
- {
- AST tmp69_AST = null;
- tmp69_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp69_AST);
- match(LITERAL_private);
- modifier_AST = currentAST.root;
- break;
- }
- case LITERAL_protected:
- {
- AST tmp70_AST = null;
- tmp70_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp70_AST);
- match(LITERAL_protected);
- modifier_AST = currentAST.root;
- break;
- }
- case LITERAL_internal:
- {
- AST tmp71_AST = null;
- tmp71_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp71_AST);
- match(LITERAL_internal);
- modifier_AST = currentAST.root;
- break;
- }
- case LITERAL_static:
- {
- AST tmp72_AST = null;
- tmp72_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp72_AST);
- match(LITERAL_static);
- modifier_AST = currentAST.root;
- break;
- }
- case LITERAL_final:
- {
- AST tmp73_AST = null;
- tmp73_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp73_AST);
- match(LITERAL_final);
- modifier_AST = currentAST.root;
- break;
- }
- case LITERAL_enumerable:
- {
- AST tmp74_AST = null;
- tmp74_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp74_AST);
- match(LITERAL_enumerable);
- modifier_AST = currentAST.root;
- break;
- }
- case LITERAL_explicit:
- {
- AST tmp75_AST = null;
- tmp75_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp75_AST);
- match(LITERAL_explicit);
- modifier_AST = currentAST.root;
- break;
- }
- case LITERAL_override:
- {
- AST tmp76_AST = null;
- tmp76_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp76_AST);
- match(LITERAL_override);
- modifier_AST = currentAST.root;
- break;
- }
- case LITERAL_dynamic:
- {
- AST tmp77_AST = null;
- tmp77_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp77_AST);
- match(LITERAL_dynamic);
- modifier_AST = currentAST.root;
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- returnAST = modifier_AST;
- }
-
- public void arguments() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST modifier_AST = null;
+
+ switch ( LA(1) )
+ {
+ case LITERAL_public:
+ {
+ AST tmp68_AST = null;
+ tmp68_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp68_AST);
+ match(LITERAL_public);
+ modifier_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_private:
+ {
+ AST tmp69_AST = null;
+ tmp69_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp69_AST);
+ match(LITERAL_private);
+ modifier_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_protected:
+ {
+ AST tmp70_AST = null;
+ tmp70_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp70_AST);
+ match(LITERAL_protected);
+ modifier_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_internal:
+ {
+ AST tmp71_AST = null;
+ tmp71_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp71_AST);
+ match(LITERAL_internal);
+ modifier_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_static:
+ {
+ AST tmp72_AST = null;
+ tmp72_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp72_AST);
+ match(LITERAL_static);
+ modifier_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_final:
+ {
+ AST tmp73_AST = null;
+ tmp73_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp73_AST);
+ match(LITERAL_final);
+ modifier_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_enumerable:
+ {
+ AST tmp74_AST = null;
+ tmp74_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp74_AST);
+ match(LITERAL_enumerable);
+ modifier_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_explicit:
+ {
+ AST tmp75_AST = null;
+ tmp75_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp75_AST);
+ match(LITERAL_explicit);
+ modifier_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_override:
+ {
+ AST tmp76_AST = null;
+ tmp76_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp76_AST);
+ match(LITERAL_override);
+ modifier_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_dynamic:
+ {
+ AST tmp77_AST = null;
+ tmp77_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp77_AST);
+ match(LITERAL_dynamic);
+ modifier_AST = currentAST.root;
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = modifier_AST;
+ }
+
+ public void arguments() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST arguments_AST = null;
-
- {
- switch ( LA(1) )
- {
- case LCURLY:
- case LBRACK:
- case LPAREN:
- case LITERAL_function:
- case IDENT:
- case NUMBER:
- case PLUS:
- case MINUS:
- case INC:
- case DEC:
- case LITERAL_delete:
- case LITERAL_typeof:
- case LNOT:
- case BNOT:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- expressionList();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case RPAREN:
- {
- if (0==inputState.guessing)
- {
- arguments_AST = (AST)currentAST.root;
- arguments_AST = astFactory.create(ELIST,"ELIST");
- currentAST.root = arguments_AST;
- if ( (null != arguments_AST) && (null != arguments_AST.getFirstChild()) )
- currentAST.child = arguments_AST.getFirstChild();
- else
- currentAST.child = arguments_AST;
- currentAST.advanceChildToEnd();
- }
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- arguments_AST = currentAST.root;
- returnAST = arguments_AST;
- }
-
- public void arrayLiteral() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST arguments_AST = null;
+
+ {
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ case LBRACK:
+ case LPAREN:
+ case LITERAL_function:
+ case IDENT:
+ case NUMBER:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case LITERAL_delete:
+ case LITERAL_typeof:
+ case LNOT:
+ case BNOT:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ expressionList();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case RPAREN:
+ {
+ if (0==inputState.guessing)
+ {
+ arguments_AST = (AST)currentAST.root;
+ arguments_AST = astFactory.create(ELIST,"ELIST");
+ currentAST.root = arguments_AST;
+ if ( (null != arguments_AST) && (null != arguments_AST.getFirstChild()) )
+ currentAST.child = arguments_AST.getFirstChild();
+ else
+ currentAST.child = arguments_AST;
+ currentAST.advanceChildToEnd();
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ arguments_AST = currentAST.root;
+ returnAST = arguments_AST;
+ }
+
+ public void arrayLiteral() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST arrayLiteral_AST = null;
-
- AST tmp78_AST = null;
- tmp78_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp78_AST);
- match(LBRACK);
- {
- switch ( LA(1) )
- {
- case LCURLY:
- case LBRACK:
- case COMMA:
- case LPAREN:
- case LITERAL_function:
- case IDENT:
- case NUMBER:
- case PLUS:
- case MINUS:
- case INC:
- case DEC:
- case LITERAL_delete:
- case LITERAL_typeof:
- case LNOT:
- case BNOT:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- elementList();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case RBRACK:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- AST tmp79_AST = null;
- tmp79_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp79_AST);
- match(RBRACK);
- arrayLiteral_AST = currentAST.root;
- returnAST = arrayLiteral_AST;
- }
-
- public void elementList() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST arrayLiteral_AST = null;
+
+ AST tmp78_AST = null;
+ tmp78_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp78_AST);
+ match(LBRACK);
+ {
+ switch ( LA(1) )
+ {
+ case LCURLY:
+ case LBRACK:
+ case COMMA:
+ case LPAREN:
+ case LITERAL_function:
+ case IDENT:
+ case NUMBER:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case LITERAL_delete:
+ case LITERAL_typeof:
+ case LNOT:
+ case BNOT:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ elementList();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case RBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ AST tmp79_AST = null;
+ tmp79_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp79_AST);
+ match(RBRACK);
+ arrayLiteral_AST = currentAST.root;
+ returnAST = arrayLiteral_AST;
+ }
+
+ public void elementList() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST elementList_AST = null;
-
- switch ( LA(1) )
- {
- case COMMA:
- {
- AST tmp80_AST = null;
- tmp80_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp80_AST);
- match(COMMA);
- elementList_AST = currentAST.root;
- break;
- }
- case LCURLY:
- case LBRACK:
- case LPAREN:
- case LITERAL_function:
- case IDENT:
- case NUMBER:
- case PLUS:
- case MINUS:
- case INC:
- case DEC:
- case LITERAL_delete:
- case LITERAL_typeof:
- case LNOT:
- case BNOT:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- nonemptyElementList();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- elementList_AST = currentAST.root;
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- returnAST = elementList_AST;
- }
-
- public void nonemptyElementList() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST elementList_AST = null;
+
+ switch ( LA(1) )
+ {
+ case COMMA:
+ {
+ AST tmp80_AST = null;
+ tmp80_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp80_AST);
+ match(COMMA);
+ elementList_AST = currentAST.root;
+ break;
+ }
+ case LCURLY:
+ case LBRACK:
+ case LPAREN:
+ case LITERAL_function:
+ case IDENT:
+ case NUMBER:
+ case PLUS:
+ case MINUS:
+ case INC:
+ case DEC:
+ case LITERAL_delete:
+ case LITERAL_typeof:
+ case LNOT:
+ case BNOT:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ nonemptyElementList();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ elementList_AST = currentAST.root;
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = elementList_AST;
+ }
+
+ public void nonemptyElementList() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST nonemptyElementList_AST = null;
-
- assignmentExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==COMMA))
- {
- AST tmp81_AST = null;
- tmp81_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp81_AST);
- match(COMMA);
- assignmentExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop129_breakloop;
- }
-
- }
-_loop129_breakloop: ;
- } // ( ... )*
- nonemptyElementList_AST = currentAST.root;
- returnAST = nonemptyElementList_AST;
- }
-
- public void element() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST nonemptyElementList_AST = null;
+
+ assignmentExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==COMMA))
+ {
+ AST tmp81_AST = null;
+ tmp81_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp81_AST);
+ match(COMMA);
+ assignmentExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop129_breakloop;
+ }
+
+ }
+_loop129_breakloop: ;
+ } // ( ... )*
+ nonemptyElementList_AST = currentAST.root;
+ returnAST = nonemptyElementList_AST;
+ }
+
+ public void element() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST element_AST = null;
- AST s_AST = null;
-
- assignmentExpression();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- element_AST = (AST)currentAST.root;
- element_AST = (AST) astFactory.make(astFactory.create(ELEMENT,"ELEMENT"), element_AST);
- setRegionInfo(element_AST,s_AST,null);
- currentAST.root = element_AST;
- if ( (null != element_AST) && (null != element_AST.getFirstChild()) )
- currentAST.child = element_AST.getFirstChild();
- else
- currentAST.child = element_AST;
- currentAST.advanceChildToEnd();
- }
- element_AST = currentAST.root;
- returnAST = element_AST;
- }
-
- public void objectLiteral() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST element_AST = null;
+ AST s_AST = null;
+
+ assignmentExpression();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ element_AST = (AST)currentAST.root;
+ element_AST = (AST) astFactory.make(astFactory.create(ELEMENT,"ELEMENT"), element_AST);
+ setRegionInfo(element_AST,s_AST,null);
+ currentAST.root = element_AST;
+ if ( (null != element_AST) && (null != element_AST.getFirstChild()) )
+ currentAST.child = element_AST.getFirstChild();
+ else
+ currentAST.child = element_AST;
+ currentAST.advanceChildToEnd();
+ }
+ element_AST = currentAST.root;
+ returnAST = element_AST;
+ }
+
+ public void objectLiteral() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST objectLiteral_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LCURLY);
- {
- switch ( LA(1) )
- {
- case IDENT:
- case NUMBER:
- {
- fieldList();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case RCURLY:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- e = LT(1);
- e_AST = astFactory.create(e);
- match(RCURLY);
- if (0==inputState.guessing)
- {
- objectLiteral_AST = (AST)currentAST.root;
- objectLiteral_AST = (AST) astFactory.make(astFactory.create(OBJECT_LITERAL,"OBJECT_LITERAL"), objectLiteral_AST);
- setRegionInfo(objectLiteral_AST,s_AST,e_AST);
- currentAST.root = objectLiteral_AST;
- if ( (null != objectLiteral_AST) && (null != objectLiteral_AST.getFirstChild()) )
- currentAST.child = objectLiteral_AST.getFirstChild();
- else
- currentAST.child = objectLiteral_AST;
- currentAST.advanceChildToEnd();
- }
- objectLiteral_AST = currentAST.root;
- returnAST = objectLiteral_AST;
- }
-
- public void fieldList() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST objectLiteral_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LCURLY);
+ {
+ switch ( LA(1) )
+ {
+ case IDENT:
+ case NUMBER:
+ {
+ fieldList();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case RCURLY:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ match(RCURLY);
+ if (0==inputState.guessing)
+ {
+ objectLiteral_AST = (AST)currentAST.root;
+ objectLiteral_AST = (AST) astFactory.make(astFactory.create(OBJECT_LITERAL,"OBJECT_LITERAL"), objectLiteral_AST);
+ setRegionInfo(objectLiteral_AST,s_AST,e_AST);
+ currentAST.root = objectLiteral_AST;
+ if ( (null != objectLiteral_AST) && (null != objectLiteral_AST.getFirstChild()) )
+ currentAST.child = objectLiteral_AST.getFirstChild();
+ else
+ currentAST.child = objectLiteral_AST;
+ currentAST.advanceChildToEnd();
+ }
+ objectLiteral_AST = currentAST.root;
+ returnAST = objectLiteral_AST;
+ }
+
+ public void fieldList() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST fieldList_AST = null;
-
- literalField();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==COMMA))
- {
- match(COMMA);
- {
- switch ( LA(1) )
- {
- case IDENT:
- case NUMBER:
- {
- literalField();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- case RCURLY:
- case COMMA:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- }
- else
- {
- goto _loop136_breakloop;
- }
-
- }
-_loop136_breakloop: ;
- } // ( ... )*
- fieldList_AST = currentAST.root;
- returnAST = fieldList_AST;
- }
-
- public void literalField() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST fieldList_AST = null;
+
+ literalField();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==COMMA))
+ {
+ match(COMMA);
+ {
+ switch ( LA(1) )
+ {
+ case IDENT:
+ case NUMBER:
+ {
+ literalField();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ case RCURLY:
+ case COMMA:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ }
+ else
+ {
+ goto _loop136_breakloop;
+ }
+
+ }
+_loop136_breakloop: ;
+ } // ( ... )*
+ fieldList_AST = currentAST.root;
+ returnAST = fieldList_AST;
+ }
+
+ public void literalField() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST literalField_AST = null;
- AST s_AST = null;
- AST e_AST = null;
-
- fieldName();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- match(COLON);
- element();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- literalField_AST = (AST)currentAST.root;
- literalField_AST = (AST) astFactory.make(astFactory.create(OBJECT_FIELD,"OBJECT_FIELD"), literalField_AST);
- setRegionInfo(literalField_AST,s_AST,e_AST);
- currentAST.root = literalField_AST;
- if ( (null != literalField_AST) && (null != literalField_AST.getFirstChild()) )
- currentAST.child = literalField_AST.getFirstChild();
- else
- currentAST.child = literalField_AST;
- currentAST.advanceChildToEnd();
- }
- literalField_AST = currentAST.root;
- returnAST = literalField_AST;
- }
-
- public void fieldName() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST literalField_AST = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ fieldName();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ match(COLON);
+ element();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ literalField_AST = (AST)currentAST.root;
+ literalField_AST = (AST) astFactory.make(astFactory.create(OBJECT_FIELD,"OBJECT_FIELD"), literalField_AST);
+ setRegionInfo(literalField_AST,s_AST,e_AST);
+ currentAST.root = literalField_AST;
+ if ( (null != literalField_AST) && (null != literalField_AST.getFirstChild()) )
+ currentAST.child = literalField_AST.getFirstChild();
+ else
+ currentAST.child = literalField_AST;
+ currentAST.advanceChildToEnd();
+ }
+ literalField_AST = currentAST.root;
+ returnAST = literalField_AST;
+ }
+
+ public void fieldName() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST fieldName_AST = null;
-
- switch ( LA(1) )
- {
- case IDENT:
- {
- AST tmp84_AST = null;
- tmp84_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp84_AST);
- match(IDENT);
- fieldName_AST = currentAST.root;
- break;
- }
- case NUMBER:
- {
- AST tmp85_AST = null;
- tmp85_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp85_AST);
- match(NUMBER);
- fieldName_AST = currentAST.root;
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- returnAST = fieldName_AST;
- }
-
- public void conditionalExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST fieldName_AST = null;
+
+ switch ( LA(1) )
+ {
+ case IDENT:
+ {
+ AST tmp84_AST = null;
+ tmp84_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp84_AST);
+ match(IDENT);
+ fieldName_AST = currentAST.root;
+ break;
+ }
+ case NUMBER:
+ {
+ AST tmp85_AST = null;
+ tmp85_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp85_AST);
+ match(NUMBER);
+ fieldName_AST = currentAST.root;
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = fieldName_AST;
+ }
+
+ public void conditionalExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST conditionalExpression_AST = null;
- AST s_AST = null;
- AST e_AST = null;
-
- logicalOrExpression();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==QUESTION) && (tokenSet_3_.member(LA(2))))
- {
- AST tmp86_AST = null;
- tmp86_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp86_AST);
- match(QUESTION);
- conditionalSubExpression();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- conditionalExpression_AST = (AST)currentAST.root;
- setRegionInfo(conditionalExpression_AST,s_AST,e_AST);
- }
- }
- else
- {
- goto _loop151_breakloop;
- }
-
- }
-_loop151_breakloop: ;
- } // ( ... )*
- conditionalExpression_AST = currentAST.root;
- returnAST = conditionalExpression_AST;
- }
-
- public void logicalOrExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST conditionalExpression_AST = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ logicalOrExpression();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==QUESTION) && (tokenSet_3_.member(LA(2))))
+ {
+ AST tmp86_AST = null;
+ tmp86_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp86_AST);
+ match(QUESTION);
+ conditionalSubExpression();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ conditionalExpression_AST = (AST)currentAST.root;
+ setRegionInfo(conditionalExpression_AST,s_AST,e_AST);
+ }
+ }
+ else
+ {
+ goto _loop151_breakloop;
+ }
+
+ }
+_loop151_breakloop: ;
+ } // ( ... )*
+ conditionalExpression_AST = currentAST.root;
+ returnAST = conditionalExpression_AST;
+ }
+
+ public void logicalOrExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST logicalOrExpression_AST = null;
-
- logicalAndExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==LOR))
- {
- AST tmp87_AST = null;
- tmp87_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp87_AST);
- match(LOR);
- logicalAndExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop155_breakloop;
- }
-
- }
-_loop155_breakloop: ;
- } // ( ... )*
- logicalOrExpression_AST = currentAST.root;
- returnAST = logicalOrExpression_AST;
- }
-
- public void conditionalSubExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST logicalOrExpression_AST = null;
+
+ logicalAndExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==LOR))
+ {
+ AST tmp87_AST = null;
+ tmp87_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp87_AST);
+ match(LOR);
+ logicalAndExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop155_breakloop;
+ }
+
+ }
+_loop155_breakloop: ;
+ } // ( ... )*
+ logicalOrExpression_AST = currentAST.root;
+ returnAST = logicalOrExpression_AST;
+ }
+
+ public void conditionalSubExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST conditionalSubExpression_AST = null;
- AST s_AST = null;
- AST e_AST = null;
-
- assignmentExpression();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- AST tmp88_AST = null;
- tmp88_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp88_AST);
- match(COLON);
- assignmentExpression();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- conditionalSubExpression_AST = (AST)currentAST.root;
- setRegionInfo(conditionalSubExpression_AST,s_AST,e_AST);
- }
- conditionalSubExpression_AST = currentAST.root;
- returnAST = conditionalSubExpression_AST;
- }
-
- public void logicalAndExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST conditionalSubExpression_AST = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ assignmentExpression();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ AST tmp88_AST = null;
+ tmp88_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp88_AST);
+ match(COLON);
+ assignmentExpression();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ conditionalSubExpression_AST = (AST)currentAST.root;
+ setRegionInfo(conditionalSubExpression_AST,s_AST,e_AST);
+ }
+ conditionalSubExpression_AST = currentAST.root;
+ returnAST = conditionalSubExpression_AST;
+ }
+
+ public void logicalAndExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST logicalAndExpression_AST = null;
-
- bitwiseOrExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==LAND))
- {
- AST tmp89_AST = null;
- tmp89_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp89_AST);
- match(LAND);
- bitwiseOrExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop158_breakloop;
- }
-
- }
-_loop158_breakloop: ;
- } // ( ... )*
- logicalAndExpression_AST = currentAST.root;
- returnAST = logicalAndExpression_AST;
- }
-
- public void bitwiseOrExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST logicalAndExpression_AST = null;
+
+ bitwiseOrExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==LAND))
+ {
+ AST tmp89_AST = null;
+ tmp89_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp89_AST);
+ match(LAND);
+ bitwiseOrExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop158_breakloop;
+ }
+
+ }
+_loop158_breakloop: ;
+ } // ( ... )*
+ logicalAndExpression_AST = currentAST.root;
+ returnAST = logicalAndExpression_AST;
+ }
+
+ public void bitwiseOrExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST bitwiseOrExpression_AST = null;
-
- bitwiseXorExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==BOR))
- {
- AST tmp90_AST = null;
- tmp90_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp90_AST);
- match(BOR);
- bitwiseXorExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop161_breakloop;
- }
-
- }
-_loop161_breakloop: ;
- } // ( ... )*
- bitwiseOrExpression_AST = currentAST.root;
- returnAST = bitwiseOrExpression_AST;
- }
-
- public void bitwiseXorExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST bitwiseOrExpression_AST = null;
+
+ bitwiseXorExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==BOR))
+ {
+ AST tmp90_AST = null;
+ tmp90_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp90_AST);
+ match(BOR);
+ bitwiseXorExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop161_breakloop;
+ }
+
+ }
+_loop161_breakloop: ;
+ } // ( ... )*
+ bitwiseOrExpression_AST = currentAST.root;
+ returnAST = bitwiseOrExpression_AST;
+ }
+
+ public void bitwiseXorExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST bitwiseXorExpression_AST = null;
-
- bitwiseAndExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==BXOR))
- {
- AST tmp91_AST = null;
- tmp91_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp91_AST);
- match(BXOR);
- bitwiseAndExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop164_breakloop;
- }
-
- }
-_loop164_breakloop: ;
- } // ( ... )*
- bitwiseXorExpression_AST = currentAST.root;
- returnAST = bitwiseXorExpression_AST;
- }
-
- public void bitwiseAndExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST bitwiseXorExpression_AST = null;
+
+ bitwiseAndExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==BXOR))
+ {
+ AST tmp91_AST = null;
+ tmp91_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp91_AST);
+ match(BXOR);
+ bitwiseAndExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop164_breakloop;
+ }
+
+ }
+_loop164_breakloop: ;
+ } // ( ... )*
+ bitwiseXorExpression_AST = currentAST.root;
+ returnAST = bitwiseXorExpression_AST;
+ }
+
+ public void bitwiseAndExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST bitwiseAndExpression_AST = null;
-
- equalityExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==BAND))
- {
- AST tmp92_AST = null;
- tmp92_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp92_AST);
- match(BAND);
- equalityExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop167_breakloop;
- }
-
- }
-_loop167_breakloop: ;
- } // ( ... )*
- bitwiseAndExpression_AST = currentAST.root;
- returnAST = bitwiseAndExpression_AST;
- }
-
- public void equalityExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST bitwiseAndExpression_AST = null;
+
+ equalityExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==BAND))
+ {
+ AST tmp92_AST = null;
+ tmp92_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp92_AST);
+ match(BAND);
+ equalityExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop167_breakloop;
+ }
+
+ }
+_loop167_breakloop: ;
+ } // ( ... )*
+ bitwiseAndExpression_AST = currentAST.root;
+ returnAST = bitwiseAndExpression_AST;
+ }
+
+ public void equalityExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST equalityExpression_AST = null;
-
- relationalExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if (((LA(1) >= STRICT_EQUAL && LA(1) <= EQUAL)))
- {
- {
- switch ( LA(1) )
- {
- case STRICT_EQUAL:
- {
- AST tmp93_AST = null;
- tmp93_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp93_AST);
- match(STRICT_EQUAL);
- break;
- }
- case STRICT_NOT_EQUAL:
- {
- AST tmp94_AST = null;
- tmp94_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp94_AST);
- match(STRICT_NOT_EQUAL);
- break;
- }
- case NOT_EQUAL:
- {
- AST tmp95_AST = null;
- tmp95_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp95_AST);
- match(NOT_EQUAL);
- break;
- }
- case EQUAL:
- {
- AST tmp96_AST = null;
- tmp96_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp96_AST);
- match(EQUAL);
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- relationalExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop171_breakloop;
- }
-
- }
-_loop171_breakloop: ;
- } // ( ... )*
- equalityExpression_AST = currentAST.root;
- returnAST = equalityExpression_AST;
- }
-
- public void relationalExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST equalityExpression_AST = null;
+
+ relationalExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if (((LA(1) >= STRICT_EQUAL && LA(1) <= EQUAL)))
+ {
+ {
+ switch ( LA(1) )
+ {
+ case STRICT_EQUAL:
+ {
+ AST tmp93_AST = null;
+ tmp93_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp93_AST);
+ match(STRICT_EQUAL);
+ break;
+ }
+ case STRICT_NOT_EQUAL:
+ {
+ AST tmp94_AST = null;
+ tmp94_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp94_AST);
+ match(STRICT_NOT_EQUAL);
+ break;
+ }
+ case NOT_EQUAL:
+ {
+ AST tmp95_AST = null;
+ tmp95_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp95_AST);
+ match(NOT_EQUAL);
+ break;
+ }
+ case EQUAL:
+ {
+ AST tmp96_AST = null;
+ tmp96_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp96_AST);
+ match(EQUAL);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ relationalExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop171_breakloop;
+ }
+
+ }
+_loop171_breakloop: ;
+ } // ( ... )*
+ equalityExpression_AST = currentAST.root;
+ returnAST = equalityExpression_AST;
+ }
+
+ public void relationalExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST relationalExpression_AST = null;
-
- shiftExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if (((LA(1) >= LWT && LA(1) <= LITERAL_as)))
- {
- {
- switch ( LA(1) )
- {
- case LWT:
- {
- AST tmp97_AST = null;
- tmp97_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp97_AST);
- match(LWT);
- break;
- }
- case GT:
- {
- AST tmp98_AST = null;
- tmp98_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp98_AST);
- match(GT);
- break;
- }
- case LE:
- {
- AST tmp99_AST = null;
- tmp99_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp99_AST);
- match(LE);
- break;
- }
- case GE:
- {
- AST tmp100_AST = null;
- tmp100_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp100_AST);
- match(GE);
- break;
- }
- case LITERAL_is:
- {
- AST tmp101_AST = null;
- tmp101_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp101_AST);
- match(LITERAL_is);
- break;
- }
- case LITERAL_as:
- {
- AST tmp102_AST = null;
- tmp102_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp102_AST);
- match(LITERAL_as);
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- shiftExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop175_breakloop;
- }
-
- }
-_loop175_breakloop: ;
- } // ( ... )*
- relationalExpression_AST = currentAST.root;
- returnAST = relationalExpression_AST;
- }
-
- public void shiftExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST relationalExpression_AST = null;
+
+ shiftExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if (((LA(1) >= LWT && LA(1) <= LITERAL_as)))
+ {
+ {
+ switch ( LA(1) )
+ {
+ case LWT:
+ {
+ AST tmp97_AST = null;
+ tmp97_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp97_AST);
+ match(LWT);
+ break;
+ }
+ case GT:
+ {
+ AST tmp98_AST = null;
+ tmp98_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp98_AST);
+ match(GT);
+ break;
+ }
+ case LE:
+ {
+ AST tmp99_AST = null;
+ tmp99_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp99_AST);
+ match(LE);
+ break;
+ }
+ case GE:
+ {
+ AST tmp100_AST = null;
+ tmp100_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp100_AST);
+ match(GE);
+ break;
+ }
+ case LITERAL_is:
+ {
+ AST tmp101_AST = null;
+ tmp101_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp101_AST);
+ match(LITERAL_is);
+ break;
+ }
+ case LITERAL_as:
+ {
+ AST tmp102_AST = null;
+ tmp102_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp102_AST);
+ match(LITERAL_as);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ shiftExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop175_breakloop;
+ }
+
+ }
+_loop175_breakloop: ;
+ } // ( ... )*
+ relationalExpression_AST = currentAST.root;
+ returnAST = relationalExpression_AST;
+ }
+
+ public void shiftExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST shiftExpression_AST = null;
-
- additiveExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if (((LA(1) >= SL && LA(1) <= BSR)))
- {
- {
- switch ( LA(1) )
- {
- case SL:
- {
- AST tmp103_AST = null;
- tmp103_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp103_AST);
- match(SL);
- break;
- }
- case SR:
- {
- AST tmp104_AST = null;
- tmp104_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp104_AST);
- match(SR);
- break;
- }
- case BSR:
- {
- AST tmp105_AST = null;
- tmp105_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp105_AST);
- match(BSR);
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- additiveExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop179_breakloop;
- }
-
- }
-_loop179_breakloop: ;
- } // ( ... )*
- shiftExpression_AST = currentAST.root;
- returnAST = shiftExpression_AST;
- }
-
- public void additiveExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST shiftExpression_AST = null;
+
+ additiveExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if (((LA(1) >= SL && LA(1) <= BSR)))
+ {
+ {
+ switch ( LA(1) )
+ {
+ case SL:
+ {
+ AST tmp103_AST = null;
+ tmp103_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp103_AST);
+ match(SL);
+ break;
+ }
+ case SR:
+ {
+ AST tmp104_AST = null;
+ tmp104_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp104_AST);
+ match(SR);
+ break;
+ }
+ case BSR:
+ {
+ AST tmp105_AST = null;
+ tmp105_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp105_AST);
+ match(BSR);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ additiveExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop179_breakloop;
+ }
+
+ }
+_loop179_breakloop: ;
+ } // ( ... )*
+ shiftExpression_AST = currentAST.root;
+ returnAST = shiftExpression_AST;
+ }
+
+ public void additiveExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST additiveExpression_AST = null;
-
- multiplicativeExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==PLUS||LA(1)==MINUS) && (tokenSet_3_.member(LA(2))))
- {
- {
- switch ( LA(1) )
- {
- case PLUS:
- {
- AST tmp106_AST = null;
- tmp106_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp106_AST);
- match(PLUS);
- break;
- }
- case MINUS:
- {
- AST tmp107_AST = null;
- tmp107_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp107_AST);
- match(MINUS);
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- multiplicativeExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop183_breakloop;
- }
-
- }
-_loop183_breakloop: ;
- } // ( ... )*
- additiveExpression_AST = currentAST.root;
- returnAST = additiveExpression_AST;
- }
-
- public void multiplicativeExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST additiveExpression_AST = null;
+
+ multiplicativeExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==PLUS||LA(1)==MINUS) && (tokenSet_3_.member(LA(2))))
+ {
+ {
+ switch ( LA(1) )
+ {
+ case PLUS:
+ {
+ AST tmp106_AST = null;
+ tmp106_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp106_AST);
+ match(PLUS);
+ break;
+ }
+ case MINUS:
+ {
+ AST tmp107_AST = null;
+ tmp107_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp107_AST);
+ match(MINUS);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ multiplicativeExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop183_breakloop;
+ }
+
+ }
+_loop183_breakloop: ;
+ } // ( ... )*
+ additiveExpression_AST = currentAST.root;
+ returnAST = additiveExpression_AST;
+ }
+
+ public void multiplicativeExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST multiplicativeExpression_AST = null;
-
- unaryExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==STAR||LA(1)==DIV||LA(1)==MOD))
- {
- {
- switch ( LA(1) )
- {
- case STAR:
- {
- AST tmp108_AST = null;
- tmp108_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp108_AST);
- match(STAR);
- break;
- }
- case DIV:
- {
- AST tmp109_AST = null;
- tmp109_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp109_AST);
- match(DIV);
- break;
- }
- case MOD:
- {
- AST tmp110_AST = null;
- tmp110_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp110_AST);
- match(MOD);
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- unaryExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- }
- else
- {
- goto _loop187_breakloop;
- }
-
- }
-_loop187_breakloop: ;
- } // ( ... )*
- multiplicativeExpression_AST = currentAST.root;
- returnAST = multiplicativeExpression_AST;
- }
-
- public void unaryExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST multiplicativeExpression_AST = null;
+
+ unaryExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==STAR||LA(1)==DIV||LA(1)==MOD))
+ {
+ {
+ switch ( LA(1) )
+ {
+ case STAR:
+ {
+ AST tmp108_AST = null;
+ tmp108_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp108_AST);
+ match(STAR);
+ break;
+ }
+ case DIV:
+ {
+ AST tmp109_AST = null;
+ tmp109_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp109_AST);
+ match(DIV);
+ break;
+ }
+ case MOD:
+ {
+ AST tmp110_AST = null;
+ tmp110_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp110_AST);
+ match(MOD);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ unaryExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ }
+ else
+ {
+ goto _loop187_breakloop;
+ }
+
+ }
+_loop187_breakloop: ;
+ } // ( ... )*
+ multiplicativeExpression_AST = currentAST.root;
+ returnAST = multiplicativeExpression_AST;
+ }
+
+ public void unaryExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST unaryExpression_AST = null;
-
- switch ( LA(1) )
- {
- case INC:
- {
- AST tmp111_AST = null;
- tmp111_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp111_AST);
- match(INC);
- unaryExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- unaryExpression_AST = currentAST.root;
- break;
- }
- case DEC:
- {
- AST tmp112_AST = null;
- tmp112_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp112_AST);
- match(DEC);
- unaryExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- unaryExpression_AST = currentAST.root;
- break;
- }
- case MINUS:
- {
- AST tmp113_AST = null;
- tmp113_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp113_AST);
- match(MINUS);
- if (0==inputState.guessing)
- {
- tmp113_AST.setType(UNARY_MINUS);
- }
- unaryExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- unaryExpression_AST = currentAST.root;
- break;
- }
- case PLUS:
- {
- AST tmp114_AST = null;
- tmp114_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp114_AST);
- match(PLUS);
- if (0==inputState.guessing)
- {
- tmp114_AST.setType(UNARY_PLUS);
- }
- unaryExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- unaryExpression_AST = currentAST.root;
- break;
- }
- case LCURLY:
- case LBRACK:
- case LPAREN:
- case LITERAL_function:
- case IDENT:
- case NUMBER:
- case LITERAL_delete:
- case LITERAL_typeof:
- case LNOT:
- case BNOT:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- unaryExpressionNotPlusMinus();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- unaryExpression_AST = currentAST.root;
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- returnAST = unaryExpression_AST;
- }
-
- public void unaryExpressionNotPlusMinus() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST unaryExpression_AST = null;
+
+ switch ( LA(1) )
+ {
+ case INC:
+ {
+ AST tmp111_AST = null;
+ tmp111_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp111_AST);
+ match(INC);
+ unaryExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ unaryExpression_AST = currentAST.root;
+ break;
+ }
+ case DEC:
+ {
+ AST tmp112_AST = null;
+ tmp112_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp112_AST);
+ match(DEC);
+ unaryExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ unaryExpression_AST = currentAST.root;
+ break;
+ }
+ case MINUS:
+ {
+ AST tmp113_AST = null;
+ tmp113_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp113_AST);
+ match(MINUS);
+ if (0==inputState.guessing)
+ {
+ tmp113_AST.setType(UNARY_MINUS);
+ }
+ unaryExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ unaryExpression_AST = currentAST.root;
+ break;
+ }
+ case PLUS:
+ {
+ AST tmp114_AST = null;
+ tmp114_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp114_AST);
+ match(PLUS);
+ if (0==inputState.guessing)
+ {
+ tmp114_AST.setType(UNARY_PLUS);
+ }
+ unaryExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ unaryExpression_AST = currentAST.root;
+ break;
+ }
+ case LCURLY:
+ case LBRACK:
+ case LPAREN:
+ case LITERAL_function:
+ case IDENT:
+ case NUMBER:
+ case LITERAL_delete:
+ case LITERAL_typeof:
+ case LNOT:
+ case BNOT:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ unaryExpressionNotPlusMinus();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ unaryExpression_AST = currentAST.root;
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = unaryExpression_AST;
+ }
+
+ public void unaryExpressionNotPlusMinus() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST unaryExpressionNotPlusMinus_AST = null;
-
- switch ( LA(1) )
- {
- case LITERAL_delete:
- {
- AST tmp115_AST = null;
- tmp115_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp115_AST);
- match(LITERAL_delete);
- postfixExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- unaryExpressionNotPlusMinus_AST = currentAST.root;
- break;
- }
- case LITERAL_typeof:
- {
- AST tmp116_AST = null;
- tmp116_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp116_AST);
- match(LITERAL_typeof);
- unaryExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- unaryExpressionNotPlusMinus_AST = currentAST.root;
- break;
- }
- case LNOT:
- {
- AST tmp117_AST = null;
- tmp117_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp117_AST);
- match(LNOT);
- unaryExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- unaryExpressionNotPlusMinus_AST = currentAST.root;
- break;
- }
- case BNOT:
- {
- AST tmp118_AST = null;
- tmp118_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp118_AST);
- match(BNOT);
- unaryExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- unaryExpressionNotPlusMinus_AST = currentAST.root;
- break;
- }
- case LCURLY:
- case LBRACK:
- case LPAREN:
- case LITERAL_function:
- case IDENT:
- case NUMBER:
- case LITERAL_null:
- case LITERAL_true:
- case LITERAL_false:
- case LITERAL_undefined:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- case LITERAL_new:
- {
- postfixExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- unaryExpressionNotPlusMinus_AST = currentAST.root;
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- returnAST = unaryExpressionNotPlusMinus_AST;
- }
-
- public void postfixExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST unaryExpressionNotPlusMinus_AST = null;
+
+ switch ( LA(1) )
+ {
+ case LITERAL_delete:
+ {
+ AST tmp115_AST = null;
+ tmp115_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp115_AST);
+ match(LITERAL_delete);
+ postfixExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ unaryExpressionNotPlusMinus_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_typeof:
+ {
+ AST tmp116_AST = null;
+ tmp116_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp116_AST);
+ match(LITERAL_typeof);
+ unaryExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ unaryExpressionNotPlusMinus_AST = currentAST.root;
+ break;
+ }
+ case LNOT:
+ {
+ AST tmp117_AST = null;
+ tmp117_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp117_AST);
+ match(LNOT);
+ unaryExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ unaryExpressionNotPlusMinus_AST = currentAST.root;
+ break;
+ }
+ case BNOT:
+ {
+ AST tmp118_AST = null;
+ tmp118_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp118_AST);
+ match(BNOT);
+ unaryExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ unaryExpressionNotPlusMinus_AST = currentAST.root;
+ break;
+ }
+ case LCURLY:
+ case LBRACK:
+ case LPAREN:
+ case LITERAL_function:
+ case IDENT:
+ case NUMBER:
+ case LITERAL_null:
+ case LITERAL_true:
+ case LITERAL_false:
+ case LITERAL_undefined:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ case LITERAL_new:
+ {
+ postfixExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ unaryExpressionNotPlusMinus_AST = currentAST.root;
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = unaryExpressionNotPlusMinus_AST;
+ }
+
+ public void postfixExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST postfixExpression_AST = null;
- AST s_AST = null;
- IToken e11 = null;
- AST e11_AST = null;
- AST e12_AST = null;
- IToken t1 = null;
- AST t1_AST = null;
- IToken e2 = null;
- AST e2_AST = null;
- IToken t2 = null;
- AST t2_AST = null;
- IToken e3 = null;
- AST e3_AST = null;
- IToken t3 = null;
- AST t3_AST = null;
- IToken e4 = null;
- AST e4_AST = null;
- IToken oin = null;
- AST oin_AST = null;
- IToken ode = null;
- AST ode_AST = null;
-
- primaryExpression();
- if (0 == inputState.guessing)
- {
- s_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==LBRACK||LA(1)==DOT||LA(1)==E4X_DESC) && (tokenSet_11_.member(LA(2))))
- {
- {
- switch ( LA(1) )
- {
- case DOT:
- {
- match(DOT);
- {
- if ((LA(1)==IDENT) && (tokenSet_12_.member(LA(2))))
- {
- e11 = LT(1);
- e11_AST = astFactory.create(e11);
- astFactory.makeASTRoot(ref currentAST, e11_AST);
- match(IDENT);
- if (0==inputState.guessing)
- {
- setRegionInfo(e11_AST,s_AST,e11_AST);
- }
- }
- else if ((LA(1)==IDENT||LA(1)==STAR||LA(1)==E4X_ATTRI) && (tokenSet_12_.member(LA(2)))) {
- e4xExpression();
- if (0 == inputState.guessing)
- {
- e12_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- setRegionInfo(e12_AST,s_AST,e12_AST);
- }
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- break;
- }
- case LBRACK:
- {
- {
- t1 = LT(1);
- t1_AST = astFactory.create(t1);
- astFactory.makeASTRoot(ref currentAST, t1_AST);
- match(LBRACK);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- e2 = LT(1);
- e2_AST = astFactory.create(e2);
- match(RBRACK);
- if (0==inputState.guessing)
- {
- t1_AST.setType(ARRAY_ACC);
- t1_AST.setText("ARRAY_ACC");
- setRegionInfo(t1_AST,s_AST,e2_AST);
- }
- }
- break;
- }
- case E4X_DESC:
- {
- AST tmp120_AST = null;
- tmp120_AST = astFactory.create(LT(1));
- astFactory.makeASTRoot(ref currentAST, tmp120_AST);
- match(E4X_DESC);
- e4xExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- {
- if ((LA(1)==LPAREN) && (tokenSet_13_.member(LA(2))))
- {
- t2 = LT(1);
- t2_AST = astFactory.create(t2);
- astFactory.makeASTRoot(ref currentAST, t2_AST);
- match(LPAREN);
- arguments();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- e3 = LT(1);
- e3_AST = astFactory.create(e3);
- match(RPAREN);
- if (0==inputState.guessing)
- {
- t2_AST.setType(METHOD_CALL);
- t2_AST.setText("METHOD_CALL");
- setRegionInfo(t2_AST,s_AST,e3_AST);
- }
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==LPAREN) && (tokenSet_13_.member(LA(2))))
- {
- t3 = LT(1);
- t3_AST = astFactory.create(t3);
- astFactory.makeASTRoot(ref currentAST, t3_AST);
- match(LPAREN);
- arguments();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- e4 = LT(1);
- e4_AST = astFactory.create(e4);
- match(RPAREN);
- if (0==inputState.guessing)
- {
- t3_AST.setType(METHOD_CALL);
- t3_AST.setText("METHOD_CALL");
- setRegionInfo(t3_AST,s_AST,e4_AST);
- }
- }
- else
- {
- goto _loop197_breakloop;
- }
-
- }
-_loop197_breakloop: ;
- } // ( ... )*
- }
- else if ((tokenSet_12_.member(LA(1))) && (tokenSet_14_.member(LA(2)))) {
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- }
- else
- {
- goto _loop198_breakloop;
- }
-
- }
-_loop198_breakloop: ;
- } // ( ... )*
- {
- if ((LA(1)==INC) && (tokenSet_12_.member(LA(2))))
- {
- oin = LT(1);
- oin_AST = astFactory.create(oin);
- astFactory.makeASTRoot(ref currentAST, oin_AST);
- match(INC);
- if (0==inputState.guessing)
- {
- oin_AST.setType(POST_INC);
- }
- }
- else if ((LA(1)==DEC) && (tokenSet_12_.member(LA(2)))) {
- ode = LT(1);
- ode_AST = astFactory.create(ode);
- astFactory.makeASTRoot(ref currentAST, ode_AST);
- match(DEC);
- if (0==inputState.guessing)
- {
- ode_AST.setType(POST_DEC);
- }
- }
- else if ((tokenSet_12_.member(LA(1))) && (tokenSet_14_.member(LA(2)))) {
- }
- else
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
-
- }
- postfixExpression_AST = currentAST.root;
- returnAST = postfixExpression_AST;
- }
-
- public void primaryExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST postfixExpression_AST = null;
+ AST s_AST = null;
+ IToken e11 = null;
+ AST e11_AST = null;
+ AST e12_AST = null;
+ IToken t1 = null;
+ AST t1_AST = null;
+ IToken e2 = null;
+ AST e2_AST = null;
+ IToken t2 = null;
+ AST t2_AST = null;
+ IToken e3 = null;
+ AST e3_AST = null;
+ IToken t3 = null;
+ AST t3_AST = null;
+ IToken e4 = null;
+ AST e4_AST = null;
+ IToken oin = null;
+ AST oin_AST = null;
+ IToken ode = null;
+ AST ode_AST = null;
+
+ primaryExpression();
+ if (0 == inputState.guessing)
+ {
+ s_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==LBRACK||LA(1)==DOT||LA(1)==E4X_DESC) && (tokenSet_11_.member(LA(2))))
+ {
+ {
+ switch ( LA(1) )
+ {
+ case DOT:
+ {
+ match(DOT);
+ {
+ if ((LA(1)==IDENT) && (tokenSet_12_.member(LA(2))))
+ {
+ e11 = LT(1);
+ e11_AST = astFactory.create(e11);
+ astFactory.makeASTRoot(ref currentAST, e11_AST);
+ match(IDENT);
+ if (0==inputState.guessing)
+ {
+ setRegionInfo(e11_AST,s_AST,e11_AST);
+ }
+ }
+ else if ((LA(1)==IDENT||LA(1)==STAR||LA(1)==E4X_ATTRI) && (tokenSet_12_.member(LA(2)))) {
+ e4xExpression();
+ if (0 == inputState.guessing)
+ {
+ e12_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ setRegionInfo(e12_AST,s_AST,e12_AST);
+ }
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ break;
+ }
+ case LBRACK:
+ {
+ {
+ t1 = LT(1);
+ t1_AST = astFactory.create(t1);
+ astFactory.makeASTRoot(ref currentAST, t1_AST);
+ match(LBRACK);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ e2 = LT(1);
+ e2_AST = astFactory.create(e2);
+ match(RBRACK);
+ if (0==inputState.guessing)
+ {
+ t1_AST.setType(ARRAY_ACC);
+ t1_AST.setText("ARRAY_ACC");
+ setRegionInfo(t1_AST,s_AST,e2_AST);
+ }
+ }
+ break;
+ }
+ case E4X_DESC:
+ {
+ AST tmp120_AST = null;
+ tmp120_AST = astFactory.create(LT(1));
+ astFactory.makeASTRoot(ref currentAST, tmp120_AST);
+ match(E4X_DESC);
+ e4xExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ {
+ if ((LA(1)==LPAREN) && (tokenSet_13_.member(LA(2))))
+ {
+ t2 = LT(1);
+ t2_AST = astFactory.create(t2);
+ astFactory.makeASTRoot(ref currentAST, t2_AST);
+ match(LPAREN);
+ arguments();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ e3 = LT(1);
+ e3_AST = astFactory.create(e3);
+ match(RPAREN);
+ if (0==inputState.guessing)
+ {
+ t2_AST.setType(METHOD_CALL);
+ t2_AST.setText("METHOD_CALL");
+ setRegionInfo(t2_AST,s_AST,e3_AST);
+ }
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==LPAREN) && (tokenSet_13_.member(LA(2))))
+ {
+ t3 = LT(1);
+ t3_AST = astFactory.create(t3);
+ astFactory.makeASTRoot(ref currentAST, t3_AST);
+ match(LPAREN);
+ arguments();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ e4 = LT(1);
+ e4_AST = astFactory.create(e4);
+ match(RPAREN);
+ if (0==inputState.guessing)
+ {
+ t3_AST.setType(METHOD_CALL);
+ t3_AST.setText("METHOD_CALL");
+ setRegionInfo(t3_AST,s_AST,e4_AST);
+ }
+ }
+ else
+ {
+ goto _loop197_breakloop;
+ }
+
+ }
+_loop197_breakloop: ;
+ } // ( ... )*
+ }
+ else if ((tokenSet_12_.member(LA(1))) && (tokenSet_14_.member(LA(2)))) {
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ }
+ else
+ {
+ goto _loop198_breakloop;
+ }
+
+ }
+_loop198_breakloop: ;
+ } // ( ... )*
+ {
+ if ((LA(1)==INC) && (tokenSet_12_.member(LA(2))))
+ {
+ oin = LT(1);
+ oin_AST = astFactory.create(oin);
+ astFactory.makeASTRoot(ref currentAST, oin_AST);
+ match(INC);
+ if (0==inputState.guessing)
+ {
+ oin_AST.setType(POST_INC);
+ }
+ }
+ else if ((LA(1)==DEC) && (tokenSet_12_.member(LA(2)))) {
+ ode = LT(1);
+ ode_AST = astFactory.create(ode);
+ astFactory.makeASTRoot(ref currentAST, ode_AST);
+ match(DEC);
+ if (0==inputState.guessing)
+ {
+ ode_AST.setType(POST_DEC);
+ }
+ }
+ else if ((tokenSet_12_.member(LA(1))) && (tokenSet_14_.member(LA(2)))) {
+ }
+ else
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+
+ }
+ postfixExpression_AST = currentAST.root;
+ returnAST = postfixExpression_AST;
+ }
+
+ public void primaryExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST primaryExpression_AST = null;
-
- switch ( LA(1) )
- {
- case IDENT:
- {
- identPrimary();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- primaryExpression_AST = currentAST.root;
- break;
- }
- case LITERAL_null:
- {
- AST tmp121_AST = null;
- tmp121_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp121_AST);
- match(LITERAL_null);
- primaryExpression_AST = currentAST.root;
- break;
- }
- case LITERAL_true:
- {
- AST tmp122_AST = null;
- tmp122_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp122_AST);
- match(LITERAL_true);
- primaryExpression_AST = currentAST.root;
- break;
- }
- case LITERAL_false:
- {
- AST tmp123_AST = null;
- tmp123_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp123_AST);
- match(LITERAL_false);
- primaryExpression_AST = currentAST.root;
- break;
- }
- case LITERAL_undefined:
- {
- AST tmp124_AST = null;
- tmp124_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp124_AST);
- match(LITERAL_undefined);
- primaryExpression_AST = currentAST.root;
- break;
- }
- case NUMBER:
- case STRING_LITERAL:
- case REGEX_LITERAL:
- case XML_LITERAL:
- {
- constant();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- primaryExpression_AST = currentAST.root;
- break;
- }
- case LBRACK:
- {
- arrayLiteral();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- primaryExpression_AST = currentAST.root;
- break;
- }
- case LCURLY:
- {
- objectLiteral();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- primaryExpression_AST = currentAST.root;
- break;
- }
- case LITERAL_function:
- {
- functionDefinition();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- primaryExpression_AST = currentAST.root;
- break;
- }
- case LITERAL_new:
- {
- newExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- primaryExpression_AST = currentAST.root;
- break;
- }
- case LPAREN:
- {
- encapsulatedExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- primaryExpression_AST = currentAST.root;
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- returnAST = primaryExpression_AST;
- }
-
- public void e4xExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST primaryExpression_AST = null;
+
+ switch ( LA(1) )
+ {
+ case IDENT:
+ {
+ identPrimary();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_null:
+ {
+ AST tmp121_AST = null;
+ tmp121_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp121_AST);
+ match(LITERAL_null);
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_true:
+ {
+ AST tmp122_AST = null;
+ tmp122_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp122_AST);
+ match(LITERAL_true);
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_false:
+ {
+ AST tmp123_AST = null;
+ tmp123_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp123_AST);
+ match(LITERAL_false);
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_undefined:
+ {
+ AST tmp124_AST = null;
+ tmp124_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp124_AST);
+ match(LITERAL_undefined);
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ case NUMBER:
+ case STRING_LITERAL:
+ case REGEX_LITERAL:
+ case XML_LITERAL:
+ {
+ constant();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ case LBRACK:
+ {
+ arrayLiteral();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ case LCURLY:
+ {
+ objectLiteral();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_function:
+ {
+ functionDefinition();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ case LITERAL_new:
+ {
+ newExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ case LPAREN:
+ {
+ encapsulatedExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ primaryExpression_AST = currentAST.root;
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = primaryExpression_AST;
+ }
+
+ public void e4xExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST e4xExpression_AST = null;
- IToken e12 = null;
- AST e12_AST = null;
- IToken e13 = null;
- AST e13_AST = null;
- IToken t1 = null;
- AST t1_AST = null;
- IToken e2 = null;
- AST e2_AST = null;
-
- switch ( LA(1) )
- {
- case IDENT:
- {
- AST tmp125_AST = null;
- tmp125_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp125_AST);
- match(IDENT);
- e4xExpression_AST = currentAST.root;
- break;
- }
- case STAR:
- {
- e12 = LT(1);
- e12_AST = astFactory.create(e12);
- astFactory.makeASTRoot(ref currentAST, e12_AST);
- match(STAR);
- e4xExpression_AST = currentAST.root;
- break;
- }
- case E4X_ATTRI:
- {
- e13 = LT(1);
- e13_AST = astFactory.create(e13);
- astFactory.makeASTRoot(ref currentAST, e13_AST);
- match(E4X_ATTRI);
- {
- switch ( LA(1) )
- {
- case IDENT:
- {
- AST tmp126_AST = null;
- tmp126_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp126_AST);
- match(IDENT);
- break;
- }
- case LBRACK:
- case STAR:
- {
- {
- switch ( LA(1) )
- {
- case STAR:
- {
- AST tmp127_AST = null;
- tmp127_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp127_AST);
- match(STAR);
- break;
- }
- case LBRACK:
- {
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- t1 = LT(1);
- t1_AST = astFactory.create(t1);
- astFactory.makeASTRoot(ref currentAST, t1_AST);
- match(LBRACK);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- e2 = LT(1);
- e2_AST = astFactory.create(e2);
- match(RBRACK);
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- }
- e4xExpression_AST = currentAST.root;
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- returnAST = e4xExpression_AST;
- }
-
- public void identPrimary() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST e4xExpression_AST = null;
+ IToken e12 = null;
+ AST e12_AST = null;
+ IToken e13 = null;
+ AST e13_AST = null;
+ IToken t1 = null;
+ AST t1_AST = null;
+ IToken e2 = null;
+ AST e2_AST = null;
+
+ switch ( LA(1) )
+ {
+ case IDENT:
+ {
+ AST tmp125_AST = null;
+ tmp125_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp125_AST);
+ match(IDENT);
+ e4xExpression_AST = currentAST.root;
+ break;
+ }
+ case STAR:
+ {
+ e12 = LT(1);
+ e12_AST = astFactory.create(e12);
+ astFactory.makeASTRoot(ref currentAST, e12_AST);
+ match(STAR);
+ e4xExpression_AST = currentAST.root;
+ break;
+ }
+ case E4X_ATTRI:
+ {
+ e13 = LT(1);
+ e13_AST = astFactory.create(e13);
+ astFactory.makeASTRoot(ref currentAST, e13_AST);
+ match(E4X_ATTRI);
+ {
+ switch ( LA(1) )
+ {
+ case IDENT:
+ {
+ AST tmp126_AST = null;
+ tmp126_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp126_AST);
+ match(IDENT);
+ break;
+ }
+ case LBRACK:
+ case STAR:
+ {
+ {
+ switch ( LA(1) )
+ {
+ case STAR:
+ {
+ AST tmp127_AST = null;
+ tmp127_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp127_AST);
+ match(STAR);
+ break;
+ }
+ case LBRACK:
+ {
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ t1 = LT(1);
+ t1_AST = astFactory.create(t1);
+ astFactory.makeASTRoot(ref currentAST, t1_AST);
+ match(LBRACK);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ e2 = LT(1);
+ e2_AST = astFactory.create(e2);
+ match(RBRACK);
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ }
+ e4xExpression_AST = currentAST.root;
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = e4xExpression_AST;
+ }
+
+ public void identPrimary() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST identPrimary_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e1 = null;
- AST e1_AST = null;
- IToken t1 = null;
- AST t1_AST = null;
- IToken e2 = null;
- AST e2_AST = null;
- IToken t2 = null;
- AST t2_AST = null;
- IToken e3 = null;
- AST e3_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.addASTChild(ref currentAST, s_AST);
- match(IDENT);
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==DOT) && (LA(2)==IDENT))
- {
- match(DOT);
- e1 = LT(1);
- e1_AST = astFactory.create(e1);
- astFactory.makeASTRoot(ref currentAST, e1_AST);
- match(IDENT);
- if (0==inputState.guessing)
- {
- setRegionInfo(e1_AST,s_AST,e1_AST);
- }
- }
- else if ((LA(1)==LBRACK) && (tokenSet_3_.member(LA(2)))) {
- {
- t1 = LT(1);
- t1_AST = astFactory.create(t1);
- astFactory.makeASTRoot(ref currentAST, t1_AST);
- match(LBRACK);
- expression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- e2 = LT(1);
- e2_AST = astFactory.create(e2);
- match(RBRACK);
- if (0==inputState.guessing)
- {
- t1_AST.setType(ARRAY_ACC);
- t1_AST.setText("ARRAY_ACC");
- setRegionInfo(t1_AST,s_AST,e2_AST);
- }
- }
- }
- else
- {
- goto _loop207_breakloop;
- }
-
- }
-_loop207_breakloop: ;
- } // ( ... )*
- { // ( ... )*
- for (;;)
- {
- if ((LA(1)==LPAREN) && (tokenSet_13_.member(LA(2))))
- {
- t2 = LT(1);
- t2_AST = astFactory.create(t2);
- astFactory.makeASTRoot(ref currentAST, t2_AST);
- match(LPAREN);
- arguments();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- e3 = LT(1);
- e3_AST = astFactory.create(e3);
- match(RPAREN);
- if (0==inputState.guessing)
- {
- t2_AST.setType(METHOD_CALL);
- t2_AST.setText("METHOD_CALL");
- setRegionInfo(t2_AST,s_AST,e3_AST);
- }
- }
- else
- {
- goto _loop209_breakloop;
- }
-
- }
-_loop209_breakloop: ;
- } // ( ... )*
- identPrimary_AST = currentAST.root;
- returnAST = identPrimary_AST;
- }
-
- public void constant() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST identPrimary_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e1 = null;
+ AST e1_AST = null;
+ IToken t1 = null;
+ AST t1_AST = null;
+ IToken e2 = null;
+ AST e2_AST = null;
+ IToken t2 = null;
+ AST t2_AST = null;
+ IToken e3 = null;
+ AST e3_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.addASTChild(ref currentAST, s_AST);
+ match(IDENT);
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==DOT) && (LA(2)==IDENT))
+ {
+ match(DOT);
+ e1 = LT(1);
+ e1_AST = astFactory.create(e1);
+ astFactory.makeASTRoot(ref currentAST, e1_AST);
+ match(IDENT);
+ if (0==inputState.guessing)
+ {
+ setRegionInfo(e1_AST,s_AST,e1_AST);
+ }
+ }
+ else if ((LA(1)==LBRACK) && (tokenSet_3_.member(LA(2)))) {
+ {
+ t1 = LT(1);
+ t1_AST = astFactory.create(t1);
+ astFactory.makeASTRoot(ref currentAST, t1_AST);
+ match(LBRACK);
+ expression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ e2 = LT(1);
+ e2_AST = astFactory.create(e2);
+ match(RBRACK);
+ if (0==inputState.guessing)
+ {
+ t1_AST.setType(ARRAY_ACC);
+ t1_AST.setText("ARRAY_ACC");
+ setRegionInfo(t1_AST,s_AST,e2_AST);
+ }
+ }
+ }
+ else
+ {
+ goto _loop207_breakloop;
+ }
+
+ }
+_loop207_breakloop: ;
+ } // ( ... )*
+ { // ( ... )*
+ for (;;)
+ {
+ if ((LA(1)==LPAREN) && (tokenSet_13_.member(LA(2))))
+ {
+ t2 = LT(1);
+ t2_AST = astFactory.create(t2);
+ astFactory.makeASTRoot(ref currentAST, t2_AST);
+ match(LPAREN);
+ arguments();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ e3 = LT(1);
+ e3_AST = astFactory.create(e3);
+ match(RPAREN);
+ if (0==inputState.guessing)
+ {
+ t2_AST.setType(METHOD_CALL);
+ t2_AST.setText("METHOD_CALL");
+ setRegionInfo(t2_AST,s_AST,e3_AST);
+ }
+ }
+ else
+ {
+ goto _loop209_breakloop;
+ }
+
+ }
+_loop209_breakloop: ;
+ } // ( ... )*
+ identPrimary_AST = currentAST.root;
+ returnAST = identPrimary_AST;
+ }
+
+ public void constant() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST constant_AST = null;
-
- switch ( LA(1) )
- {
- case NUMBER:
- {
- AST tmp129_AST = null;
- tmp129_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp129_AST);
- match(NUMBER);
- constant_AST = currentAST.root;
- break;
- }
- case STRING_LITERAL:
- {
- AST tmp130_AST = null;
- tmp130_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp130_AST);
- match(STRING_LITERAL);
- constant_AST = currentAST.root;
- break;
- }
- case REGEX_LITERAL:
- {
- AST tmp131_AST = null;
- tmp131_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp131_AST);
- match(REGEX_LITERAL);
- constant_AST = currentAST.root;
- break;
- }
- case XML_LITERAL:
- {
- AST tmp132_AST = null;
- tmp132_AST = astFactory.create(LT(1));
- astFactory.addASTChild(ref currentAST, tmp132_AST);
- match(XML_LITERAL);
- constant_AST = currentAST.root;
- break;
- }
- default:
- {
- throw new NoViableAltException(LT(1), getFilename());
- }
- }
- returnAST = constant_AST;
- }
-
- public void functionDefinition() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST constant_AST = null;
+
+ switch ( LA(1) )
+ {
+ case NUMBER:
+ {
+ AST tmp129_AST = null;
+ tmp129_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp129_AST);
+ match(NUMBER);
+ constant_AST = currentAST.root;
+ break;
+ }
+ case STRING_LITERAL:
+ {
+ AST tmp130_AST = null;
+ tmp130_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp130_AST);
+ match(STRING_LITERAL);
+ constant_AST = currentAST.root;
+ break;
+ }
+ case REGEX_LITERAL:
+ {
+ AST tmp131_AST = null;
+ tmp131_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp131_AST);
+ match(REGEX_LITERAL);
+ constant_AST = currentAST.root;
+ break;
+ }
+ case XML_LITERAL:
+ {
+ AST tmp132_AST = null;
+ tmp132_AST = astFactory.create(LT(1));
+ astFactory.addASTChild(ref currentAST, tmp132_AST);
+ match(XML_LITERAL);
+ constant_AST = currentAST.root;
+ break;
+ }
+ default:
+ {
+ throw new NoViableAltException(LT(1), getFilename());
+ }
+ }
+ returnAST = constant_AST;
+ }
+
+ public void functionDefinition() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST functionDefinition_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.addASTChild(ref currentAST, s_AST);
- match(LITERAL_function);
- parameterDeclarationList();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- typeExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- block();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- functionDefinition_AST = (AST)currentAST.root;
- functionDefinition_AST = (AST) astFactory.make(astFactory.create(FUNC_DEF,"FUNC_DEF"), functionDefinition_AST);
- setRegionInfo(functionDefinition_AST,s_AST,e_AST);
- currentAST.root = functionDefinition_AST;
- if ( (null != functionDefinition_AST) && (null != functionDefinition_AST.getFirstChild()) )
- currentAST.child = functionDefinition_AST.getFirstChild();
- else
- currentAST.child = functionDefinition_AST;
- currentAST.advanceChildToEnd();
- }
- functionDefinition_AST = currentAST.root;
- returnAST = functionDefinition_AST;
- }
-
- public void newExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST functionDefinition_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.addASTChild(ref currentAST, s_AST);
+ match(LITERAL_function);
+ parameterDeclarationList();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ typeExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ block();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ functionDefinition_AST = (AST)currentAST.root;
+ functionDefinition_AST = (AST) astFactory.make(astFactory.create(FUNC_DEF,"FUNC_DEF"), functionDefinition_AST);
+ setRegionInfo(functionDefinition_AST,s_AST,e_AST);
+ currentAST.root = functionDefinition_AST;
+ if ( (null != functionDefinition_AST) && (null != functionDefinition_AST.getFirstChild()) )
+ currentAST.child = functionDefinition_AST.getFirstChild();
+ else
+ currentAST.child = functionDefinition_AST;
+ currentAST.advanceChildToEnd();
+ }
+ functionDefinition_AST = currentAST.root;
+ returnAST = functionDefinition_AST;
+ }
+
+ public void newExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST newExpression_AST = null;
- IToken s = null;
- AST s_AST = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- astFactory.addASTChild(ref currentAST, s_AST);
- match(LITERAL_new);
- postfixExpression();
- if (0 == inputState.guessing)
- {
- e_AST = (AST)returnAST;
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- if (0==inputState.guessing)
- {
- newExpression_AST = (AST)currentAST.root;
- newExpression_AST = (AST) astFactory.make(astFactory.create(NEW_EXPR,"NEW_EXPR"), newExpression_AST);
- setRegionInfo(newExpression_AST,s_AST,e_AST);
- currentAST.root = newExpression_AST;
- if ( (null != newExpression_AST) && (null != newExpression_AST.getFirstChild()) )
- currentAST.child = newExpression_AST.getFirstChild();
- else
- currentAST.child = newExpression_AST;
- currentAST.advanceChildToEnd();
- }
- newExpression_AST = currentAST.root;
- returnAST = newExpression_AST;
- }
-
- public void encapsulatedExpression() //throws RecognitionException, TokenStreamException
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST newExpression_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ astFactory.addASTChild(ref currentAST, s_AST);
+ match(LITERAL_new);
+ postfixExpression();
+ if (0 == inputState.guessing)
+ {
+ e_AST = (AST)returnAST;
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ if (0==inputState.guessing)
+ {
+ newExpression_AST = (AST)currentAST.root;
+ newExpression_AST = (AST) astFactory.make(astFactory.create(NEW_EXPR,"NEW_EXPR"), newExpression_AST);
+ setRegionInfo(newExpression_AST,s_AST,e_AST);
+ currentAST.root = newExpression_AST;
+ if ( (null != newExpression_AST) && (null != newExpression_AST.getFirstChild()) )
+ currentAST.child = newExpression_AST.getFirstChild();
+ else
+ currentAST.child = newExpression_AST;
+ currentAST.advanceChildToEnd();
+ }
+ newExpression_AST = currentAST.root;
+ returnAST = newExpression_AST;
+ }
+
+ public void encapsulatedExpression() //throws RecognitionException, TokenStreamException
{
-
- returnAST = null;
- ASTPair currentAST = new ASTPair();
- AST encapsulatedExpression_AST = null;
- IToken s = null;
- AST s_AST = null;
- IToken e = null;
- AST e_AST = null;
-
- s = LT(1);
- s_AST = astFactory.create(s);
- match(LPAREN);
- assignmentExpression();
- if (0 == inputState.guessing)
- {
- astFactory.addASTChild(ref currentAST, returnAST);
- }
- e = LT(1);
- e_AST = astFactory.create(e);
- match(RPAREN);
- if (0==inputState.guessing)
- {
- encapsulatedExpression_AST = (AST)currentAST.root;
- encapsulatedExpression_AST = (AST) astFactory.make(astFactory.create(ENCPS_EXPR,"ENCPS_EXPR"), encapsulatedExpression_AST);
- setRegionInfo(encapsulatedExpression_AST,s_AST,e_AST);
- currentAST.root = encapsulatedExpression_AST;
- if ( (null != encapsulatedExpression_AST) && (null != encapsulatedExpression_AST.getFirstChild()) )
- currentAST.child = encapsulatedExpression_AST.getFirstChild();
- else
- currentAST.child = encapsulatedExpression_AST;
- currentAST.advanceChildToEnd();
- }
- encapsulatedExpression_AST = currentAST.root;
- returnAST = encapsulatedExpression_AST;
- }
-
- private void initializeFactory()
- {
- if (astFactory == null)
- {
- astFactory = new ASTFactory();
- }
- initializeASTFactory( astFactory );
- }
- static public void initializeASTFactory( ASTFactory factory )
- {
- factory.setMaxNodeType(160);
- }
-
- public static readonly string[] tokenNames_ = new string[] {
- @"""<0>""",
- @"""EOF""",
- @"""<2>""",
- @"""NULL_TREE_LOOKAHEAD""",
- @"""COMPILATION_UNIT""",
- @"""IMPORT""",
- @"""CLASS_DEF""",
- @"""INTERFACE_DEF""",
- @"""EXTENDS_CLAUSE""",
- @"""IMPLEMENTS_CLAUSE""",
- @"""TYPE_BLOCK""",
- @"""MODIFIERS""",
- @"""VARIABLE_DEF""",
- @"""METHOD_DEF""",
- @"""NAMESPACE_DEF""",
- @"""PARAMS""",
- @"""PARAM""",
- @"""TYPE_SPEC""",
- @"""BLOCK""",
- @"""EXPR""",
- @"""ELIST""",
- @"""EXPR_STMNT""",
- @"""NEW_EXPR""",
- @"""ENCPS_EXPR""",
- @"""VAR_INIT""",
- @"""METHOD_CALL""",
- @"""ARRAY_ACC""",
- @"""UNARY_PLUS""",
- @"""UNARY_MINUS""",
- @"""POST_INC""",
- @"""POST_DEC""",
- @"""ARRAY_LITERAL""",
- @"""ELEMENT""",
- @"""OBJECT_LITERAL""",
- @"""OBJECT_FIELD""",
- @"""FUNC_DEF""",
- @"""FOR_INIT""",
- @"""FOR_CONDITION""",
- @"""FOR_ITERATOR""",
- @"""package""",
- @"""LCURLY""",
- @"""SEMI""",
- @"""RCURLY""",
- @"""import""",
- @"""LBRACK""",
- @"""COMMA""",
- @"""RBRACK""",
- @"""LPAREN""",
- @"""RPAREN""",
- @"""class""",
- @"""interface""",
- @"""extends""",
- @"""implements""",
- @"""function""",
- @"""get""",
- @"""set""",
- @"""/n""",
- @"""/r""",
- @"""IDENT""",
- @"""namespace""",
- @"""var""",
- @"""const""",
- @"""ASSIGN""",
- @"""REST""",
- @"""while""",
- @"""do""",
- @"""with""",
- @"""if""",
- @"""else""",
- @"""throw""",
- @"""return""",
- @"""continue""",
- @"""break""",
- @"""switch""",
- @"""case""",
- @"""COLON""",
- @"""default""",
- @"""for""",
- @"""each""",
- @"""in""",
- @"""DOT""",
- @"""STAR""",
- @"""public""",
- @"""private""",
- @"""protected""",
- @"""internal""",
- @"""static""",
- @"""final""",
- @"""enumerable""",
- @"""explicit""",
- @"""override""",
- @"""dynamic""",
- @"""NUMBER""",
- @"""STAR_ASSIGN""",
- @"""DIV_ASSIGN""",
- @"""MOD_ASSIGN""",
- @"""PLUS_ASSIGN""",
- @"""MINUS_ASSIGN""",
- @"""SL_ASSIGN""",
- @"""SR_ASSIGN""",
- @"""BSR_ASSIGN""",
- @"""BAND_ASSIGN""",
- @"""BXOR_ASSIGN""",
- @"""BOR_ASSIGN""",
- @"""LAND_ASSIGN""",
- @"""LOR_ASSIGN""",
- @"""QUESTION""",
- @"""LOR""",
- @"""LAND""",
- @"""BOR""",
- @"""BXOR""",
- @"""BAND""",
- @"""STRICT_EQUAL""",
- @"""STRICT_NOT_EQUAL""",
- @"""NOT_EQUAL""",
- @"""EQUAL""",
- @"""LWT""",
- @"""GT""",
- @"""LE""",
- @"""GE""",
- @"""is""",
- @"""as""",
- @"""SL""",
- @"""SR""",
- @"""BSR""",
- @"""PLUS""",
- @"""MINUS""",
- @"""DIV""",
- @"""MOD""",
- @"""INC""",
- @"""DEC""",
- @"""delete""",
- @"""typeof""",
- @"""LNOT""",
- @"""BNOT""",
- @"""E4X_DESC""",
- @"""E4X_ATTRI""",
- @"""null""",
- @"""true""",
- @"""false""",
- @"""undefined""",
- @"""STRING_LITERAL""",
- @"""REGEX_LITERAL""",
- @"""XML_LITERAL""",
- @"""new""",
- @"""DBL_COLON""",
- @"""XML_ATTRIBUTE""",
- @"""XML_BINDING""",
- @"""XML_AS3_EXPRESSION""",
- @"""XML_TEXTNODE""",
- @"""XML_COMMENT""",
- @"""XML_CDATA""",
- @"""REGEX_BODY""",
- @"""WS""",
- @"""NL""",
- @"""BOM""",
- @"""SL_COMMENT""",
- @"""ML_COMMENT""",
- @"""EXPONENT""",
- @"""HEX_DIGIT""",
- @"""ESC"""
- };
-
- private static long[] mk_tokenSet_0_()
- {
- long[] data = { -216172782113783824L, -1L, 8589934591L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_0_ = new BitSet(mk_tokenSet_0_());
- private static long[] mk_tokenSet_1_()
- {
- long[] data = { 1450320708222582784L, 6917529027909526511L, 130686L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_1_ = new BitSet(mk_tokenSet_1_());
- private static long[] mk_tokenSet_2_()
- {
- long[] data = { 4611686018427387904L, 4397509640192L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_2_ = new BitSet(mk_tokenSet_2_());
- private static long[] mk_tokenSet_3_()
- {
- long[] data = { 297397004592480256L, 6917529027909517312L, 130686L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_3_ = new BitSet(mk_tokenSet_3_());
- private static long[] mk_tokenSet_4_()
- {
- long[] data = { 8946399560259862528L, 6917537823733891071L, 130686L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_4_ = new BitSet(mk_tokenSet_4_());
- private static long[] mk_tokenSet_5_()
- {
- long[] data = { -222929281066467326L, -1L, 130815L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_5_ = new BitSet(mk_tokenSet_5_());
- private static long[] mk_tokenSet_6_()
- {
- long[] data = { 1450325106269093888L, 6917529027909531647L, 130686L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_6_ = new BitSet(mk_tokenSet_6_());
- private static long[] mk_tokenSet_7_()
- {
- long[] data = { 8946399560259862528L, -1L, 130815L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_7_ = new BitSet(mk_tokenSet_7_());
- private static long[] mk_tokenSet_8_()
- {
- long[] data = { 1450325106269093888L, 6917529027909526511L, 130686L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_8_ = new BitSet(mk_tokenSet_8_());
- private static long[] mk_tokenSet_9_()
- {
- long[] data = { 6062116677812748288L, -268224513L, 130815L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_9_ = new BitSet(mk_tokenSet_9_());
- private static long[] mk_tokenSet_10_()
- {
- long[] data = { 1450320708222582784L, 6917529027909517312L, 130686L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_10_ = new BitSet(mk_tokenSet_10_());
- private static long[] mk_tokenSet_11_()
- {
- long[] data = { 297397004592480256L, 6917529027909648384L, 130942L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_11_ = new BitSet(mk_tokenSet_11_());
- private static long[] mk_tokenSet_12_()
- {
- long[] data = { 8946399560259862528L, -16385L, 130815L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_12_ = new BitSet(mk_tokenSet_12_());
- private static long[] mk_tokenSet_13_()
- {
- long[] data = { 297678479569190912L, 6917529027909517312L, 130686L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_13_ = new BitSet(mk_tokenSet_13_());
- private static long[] mk_tokenSet_14_()
- {
- long[] data = { -222929281066467326L, -1L, 131071L, 0L, 0L, 0L};
- return data;
- }
- public static readonly BitSet tokenSet_14_ = new BitSet(mk_tokenSet_14_());
-
+
+ returnAST = null;
+ ASTPair currentAST = new ASTPair();
+ AST encapsulatedExpression_AST = null;
+ IToken s = null;
+ AST s_AST = null;
+ IToken e = null;
+ AST e_AST = null;
+
+ s = LT(1);
+ s_AST = astFactory.create(s);
+ match(LPAREN);
+ assignmentExpression();
+ if (0 == inputState.guessing)
+ {
+ astFactory.addASTChild(ref currentAST, returnAST);
+ }
+ e = LT(1);
+ e_AST = astFactory.create(e);
+ match(RPAREN);
+ if (0==inputState.guessing)
+ {
+ encapsulatedExpression_AST = (AST)currentAST.root;
+ encapsulatedExpression_AST = (AST) astFactory.make(astFactory.create(ENCPS_EXPR,"ENCPS_EXPR"), encapsulatedExpression_AST);
+ setRegionInfo(encapsulatedExpression_AST,s_AST,e_AST);
+ currentAST.root = encapsulatedExpression_AST;
+ if ( (null != encapsulatedExpression_AST) && (null != encapsulatedExpression_AST.getFirstChild()) )
+ currentAST.child = encapsulatedExpression_AST.getFirstChild();
+ else
+ currentAST.child = encapsulatedExpression_AST;
+ currentAST.advanceChildToEnd();
+ }
+ encapsulatedExpression_AST = currentAST.root;
+ returnAST = encapsulatedExpression_AST;
+ }
+
+ private void initializeFactory()
+ {
+ if (astFactory == null)
+ {
+ astFactory = new ASTFactory();
+ }
+ initializeASTFactory( astFactory );
+ }
+ static public void initializeASTFactory( ASTFactory factory )
+ {
+ factory.setMaxNodeType(160);
+ }
+
+ public static readonly string[] tokenNames_ = new string[] {
+ @"""<0>""",
+ @"""EOF""",
+ @"""<2>""",
+ @"""NULL_TREE_LOOKAHEAD""",
+ @"""COMPILATION_UNIT""",
+ @"""IMPORT""",
+ @"""CLASS_DEF""",
+ @"""INTERFACE_DEF""",
+ @"""EXTENDS_CLAUSE""",
+ @"""IMPLEMENTS_CLAUSE""",
+ @"""TYPE_BLOCK""",
+ @"""MODIFIERS""",
+ @"""VARIABLE_DEF""",
+ @"""METHOD_DEF""",
+ @"""NAMESPACE_DEF""",
+ @"""PARAMS""",
+ @"""PARAM""",
+ @"""TYPE_SPEC""",
+ @"""BLOCK""",
+ @"""EXPR""",
+ @"""ELIST""",
+ @"""EXPR_STMNT""",
+ @"""NEW_EXPR""",
+ @"""ENCPS_EXPR""",
+ @"""VAR_INIT""",
+ @"""METHOD_CALL""",
+ @"""ARRAY_ACC""",
+ @"""UNARY_PLUS""",
+ @"""UNARY_MINUS""",
+ @"""POST_INC""",
+ @"""POST_DEC""",
+ @"""ARRAY_LITERAL""",
+ @"""ELEMENT""",
+ @"""OBJECT_LITERAL""",
+ @"""OBJECT_FIELD""",
+ @"""FUNC_DEF""",
+ @"""FOR_INIT""",
+ @"""FOR_CONDITION""",
+ @"""FOR_ITERATOR""",
+ @"""package""",
+ @"""LCURLY""",
+ @"""SEMI""",
+ @"""RCURLY""",
+ @"""import""",
+ @"""LBRACK""",
+ @"""COMMA""",
+ @"""RBRACK""",
+ @"""LPAREN""",
+ @"""RPAREN""",
+ @"""class""",
+ @"""interface""",
+ @"""extends""",
+ @"""implements""",
+ @"""function""",
+ @"""get""",
+ @"""set""",
+ @"""/n""",
+ @"""/r""",
+ @"""IDENT""",
+ @"""namespace""",
+ @"""var""",
+ @"""const""",
+ @"""ASSIGN""",
+ @"""REST""",
+ @"""while""",
+ @"""do""",
+ @"""with""",
+ @"""if""",
+ @"""else""",
+ @"""throw""",
+ @"""return""",
+ @"""continue""",
+ @"""break""",
+ @"""switch""",
+ @"""case""",
+ @"""COLON""",
+ @"""default""",
+ @"""for""",
+ @"""each""",
+ @"""in""",
+ @"""DOT""",
+ @"""STAR""",
+ @"""public""",
+ @"""private""",
+ @"""protected""",
+ @"""internal""",
+ @"""static""",
+ @"""final""",
+ @"""enumerable""",
+ @"""explicit""",
+ @"""override""",
+ @"""dynamic""",
+ @"""NUMBER""",
+ @"""STAR_ASSIGN""",
+ @"""DIV_ASSIGN""",
+ @"""MOD_ASSIGN""",
+ @"""PLUS_ASSIGN""",
+ @"""MINUS_ASSIGN""",
+ @"""SL_ASSIGN""",
+ @"""SR_ASSIGN""",
+ @"""BSR_ASSIGN""",
+ @"""BAND_ASSIGN""",
+ @"""BXOR_ASSIGN""",
+ @"""BOR_ASSIGN""",
+ @"""LAND_ASSIGN""",
+ @"""LOR_ASSIGN""",
+ @"""QUESTION""",
+ @"""LOR""",
+ @"""LAND""",
+ @"""BOR""",
+ @"""BXOR""",
+ @"""BAND""",
+ @"""STRICT_EQUAL""",
+ @"""STRICT_NOT_EQUAL""",
+ @"""NOT_EQUAL""",
+ @"""EQUAL""",
+ @"""LWT""",
+ @"""GT""",
+ @"""LE""",
+ @"""GE""",
+ @"""is""",
+ @"""as""",
+ @"""SL""",
+ @"""SR""",
+ @"""BSR""",
+ @"""PLUS""",
+ @"""MINUS""",
+ @"""DIV""",
+ @"""MOD""",
+ @"""INC""",
+ @"""DEC""",
+ @"""delete""",
+ @"""typeof""",
+ @"""LNOT""",
+ @"""BNOT""",
+ @"""E4X_DESC""",
+ @"""E4X_ATTRI""",
+ @"""null""",
+ @"""true""",
+ @"""false""",
+ @"""undefined""",
+ @"""STRING_LITERAL""",
+ @"""REGEX_LITERAL""",
+ @"""XML_LITERAL""",
+ @"""new""",
+ @"""DBL_COLON""",
+ @"""XML_ATTRIBUTE""",
+ @"""XML_BINDING""",
+ @"""XML_AS3_EXPRESSION""",
+ @"""XML_TEXTNODE""",
+ @"""XML_COMMENT""",
+ @"""XML_CDATA""",
+ @"""REGEX_BODY""",
+ @"""WS""",
+ @"""NL""",
+ @"""BOM""",
+ @"""SL_COMMENT""",
+ @"""ML_COMMENT""",
+ @"""EXPONENT""",
+ @"""HEX_DIGIT""",
+ @"""ESC"""
+ };
+
+ private static long[] mk_tokenSet_0_()
+ {
+ long[] data = { -216172782113783824L, -1L, 8589934591L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_0_ = new BitSet(mk_tokenSet_0_());
+ private static long[] mk_tokenSet_1_()
+ {
+ long[] data = { 1450320708222582784L, 6917529027909526511L, 130686L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_1_ = new BitSet(mk_tokenSet_1_());
+ private static long[] mk_tokenSet_2_()
+ {
+ long[] data = { 4611686018427387904L, 4397509640192L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_2_ = new BitSet(mk_tokenSet_2_());
+ private static long[] mk_tokenSet_3_()
+ {
+ long[] data = { 297397004592480256L, 6917529027909517312L, 130686L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_3_ = new BitSet(mk_tokenSet_3_());
+ private static long[] mk_tokenSet_4_()
+ {
+ long[] data = { 8946399560259862528L, 6917537823733891071L, 130686L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_4_ = new BitSet(mk_tokenSet_4_());
+ private static long[] mk_tokenSet_5_()
+ {
+ long[] data = { -222929281066467326L, -1L, 130815L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_5_ = new BitSet(mk_tokenSet_5_());
+ private static long[] mk_tokenSet_6_()
+ {
+ long[] data = { 1450325106269093888L, 6917529027909531647L, 130686L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_6_ = new BitSet(mk_tokenSet_6_());
+ private static long[] mk_tokenSet_7_()
+ {
+ long[] data = { 8946399560259862528L, -1L, 130815L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_7_ = new BitSet(mk_tokenSet_7_());
+ private static long[] mk_tokenSet_8_()
+ {
+ long[] data = { 1450325106269093888L, 6917529027909526511L, 130686L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_8_ = new BitSet(mk_tokenSet_8_());
+ private static long[] mk_tokenSet_9_()
+ {
+ long[] data = { 6062116677812748288L, -268224513L, 130815L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_9_ = new BitSet(mk_tokenSet_9_());
+ private static long[] mk_tokenSet_10_()
+ {
+ long[] data = { 1450320708222582784L, 6917529027909517312L, 130686L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_10_ = new BitSet(mk_tokenSet_10_());
+ private static long[] mk_tokenSet_11_()
+ {
+ long[] data = { 297397004592480256L, 6917529027909648384L, 130942L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_11_ = new BitSet(mk_tokenSet_11_());
+ private static long[] mk_tokenSet_12_()
+ {
+ long[] data = { 8946399560259862528L, -16385L, 130815L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_12_ = new BitSet(mk_tokenSet_12_());
+ private static long[] mk_tokenSet_13_()
+ {
+ long[] data = { 297678479569190912L, 6917529027909517312L, 130686L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_13_ = new BitSet(mk_tokenSet_13_());
+ private static long[] mk_tokenSet_14_()
+ {
+ long[] data = { -222929281066467326L, -1L, 131071L, 0L, 0L, 0L};
+ return data;
+ }
+ public static readonly BitSet tokenSet_14_ = new BitSet(mk_tokenSet_14_());
+
}
}
diff --git a/External/Plugins/AS3Context/Grammar/AS3TokenTypes.cs b/External/Plugins/AS3Context/Grammar/AS3TokenTypes.cs
index ed0eaf3130..8ffff27eea 100644
--- a/External/Plugins/AS3Context/Grammar/AS3TokenTypes.cs
+++ b/External/Plugins/AS3Context/Grammar/AS3TokenTypes.cs
@@ -34,167 +34,167 @@
namespace AS3Context.Grammar
{
- public class AS3TokenTypes
- {
- public const int EOF = 1;
- public const int NULL_TREE_LOOKAHEAD = 3;
- public const int COMPILATION_UNIT = 4;
- public const int IMPORT = 5;
- public const int CLASS_DEF = 6;
- public const int INTERFACE_DEF = 7;
- public const int EXTENDS_CLAUSE = 8;
- public const int IMPLEMENTS_CLAUSE = 9;
- public const int TYPE_BLOCK = 10;
- public const int MODIFIERS = 11;
- public const int VARIABLE_DEF = 12;
- public const int METHOD_DEF = 13;
- public const int NAMESPACE_DEF = 14;
- public const int PARAMS = 15;
- public const int PARAM = 16;
- public const int TYPE_SPEC = 17;
- public const int BLOCK = 18;
- public const int EXPR = 19;
- public const int ELIST = 20;
- public const int EXPR_STMNT = 21;
- public const int NEW_EXPR = 22;
- public const int ENCPS_EXPR = 23;
- public const int VAR_INIT = 24;
- public const int METHOD_CALL = 25;
- public const int ARRAY_ACC = 26;
- public const int UNARY_PLUS = 27;
- public const int UNARY_MINUS = 28;
- public const int POST_INC = 29;
- public const int POST_DEC = 30;
- public const int ARRAY_LITERAL = 31;
- public const int ELEMENT = 32;
- public const int OBJECT_LITERAL = 33;
- public const int OBJECT_FIELD = 34;
- public const int FUNC_DEF = 35;
- public const int FOR_INIT = 36;
- public const int FOR_CONDITION = 37;
- public const int FOR_ITERATOR = 38;
- public const int LITERAL_package = 39;
- public const int LCURLY = 40;
- public const int SEMI = 41;
- public const int RCURLY = 42;
- public const int LITERAL_import = 43;
- public const int LBRACK = 44;
- public const int COMMA = 45;
- public const int RBRACK = 46;
- public const int LPAREN = 47;
- public const int RPAREN = 48;
- public const int LITERAL_class = 49;
- public const int LITERAL_interface = 50;
- public const int LITERAL_extends = 51;
- public const int LITERAL_implements = 52;
- public const int LITERAL_function = 53;
- public const int LITERAL_get = 54;
- public const int LITERAL_set = 55;
- // "/n" = 56
- // "/r" = 57
- public const int IDENT = 58;
- public const int LITERAL_namespace = 59;
- public const int LITERAL_var = 60;
- public const int LITERAL_const = 61;
- public const int ASSIGN = 62;
- public const int REST = 63;
- public const int LITERAL_while = 64;
- public const int LITERAL_do = 65;
- public const int LITERAL_with = 66;
- public const int LITERAL_if = 67;
- public const int LITERAL_else = 68;
- public const int LITERAL_throw = 69;
- public const int LITERAL_return = 70;
- public const int LITERAL_continue = 71;
- public const int LITERAL_break = 72;
- public const int LITERAL_switch = 73;
- public const int LITERAL_case = 74;
- public const int COLON = 75;
- public const int LITERAL_default = 76;
- public const int LITERAL_for = 77;
- public const int LITERAL_each = 78;
- public const int LITERAL_in = 79;
- public const int DOT = 80;
- public const int STAR = 81;
- public const int LITERAL_public = 82;
- public const int LITERAL_private = 83;
- public const int LITERAL_protected = 84;
- public const int LITERAL_internal = 85;
- public const int LITERAL_static = 86;
- public const int LITERAL_final = 87;
- public const int LITERAL_enumerable = 88;
- public const int LITERAL_explicit = 89;
- public const int LITERAL_override = 90;
- public const int LITERAL_dynamic = 91;
- public const int NUMBER = 92;
- public const int STAR_ASSIGN = 93;
- public const int DIV_ASSIGN = 94;
- public const int MOD_ASSIGN = 95;
- public const int PLUS_ASSIGN = 96;
- public const int MINUS_ASSIGN = 97;
- public const int SL_ASSIGN = 98;
- public const int SR_ASSIGN = 99;
- public const int BSR_ASSIGN = 100;
- public const int BAND_ASSIGN = 101;
- public const int BXOR_ASSIGN = 102;
- public const int BOR_ASSIGN = 103;
- public const int LAND_ASSIGN = 104;
- public const int LOR_ASSIGN = 105;
- public const int QUESTION = 106;
- public const int LOR = 107;
- public const int LAND = 108;
- public const int BOR = 109;
- public const int BXOR = 110;
- public const int BAND = 111;
- public const int STRICT_EQUAL = 112;
- public const int STRICT_NOT_EQUAL = 113;
- public const int NOT_EQUAL = 114;
- public const int EQUAL = 115;
- public const int LWT = 116;
- public const int GT = 117;
- public const int LE = 118;
- public const int GE = 119;
- public const int LITERAL_is = 120;
- public const int LITERAL_as = 121;
- public const int SL = 122;
- public const int SR = 123;
- public const int BSR = 124;
- public const int PLUS = 125;
- public const int MINUS = 126;
- public const int DIV = 127;
- public const int MOD = 128;
- public const int INC = 129;
- public const int DEC = 130;
- public const int LITERAL_delete = 131;
- public const int LITERAL_typeof = 132;
- public const int LNOT = 133;
- public const int BNOT = 134;
- public const int E4X_DESC = 135;
- public const int E4X_ATTRI = 136;
- public const int LITERAL_null = 137;
- public const int LITERAL_true = 138;
- public const int LITERAL_false = 139;
- public const int LITERAL_undefined = 140;
- public const int STRING_LITERAL = 141;
- public const int REGEX_LITERAL = 142;
- public const int XML_LITERAL = 143;
- public const int LITERAL_new = 144;
- public const int DBL_COLON = 145;
- public const int XML_ATTRIBUTE = 146;
- public const int XML_BINDING = 147;
- public const int XML_AS3_EXPRESSION = 148;
- public const int XML_TEXTNODE = 149;
- public const int XML_COMMENT = 150;
- public const int XML_CDATA = 151;
- public const int REGEX_BODY = 152;
- public const int WS = 153;
- public const int NL = 154;
- public const int BOM = 155;
- public const int SL_COMMENT = 156;
- public const int ML_COMMENT = 157;
- public const int EXPONENT = 158;
- public const int HEX_DIGIT = 159;
- public const int ESC = 160;
-
- }
+ public class AS3TokenTypes
+ {
+ public const int EOF = 1;
+ public const int NULL_TREE_LOOKAHEAD = 3;
+ public const int COMPILATION_UNIT = 4;
+ public const int IMPORT = 5;
+ public const int CLASS_DEF = 6;
+ public const int INTERFACE_DEF = 7;
+ public const int EXTENDS_CLAUSE = 8;
+ public const int IMPLEMENTS_CLAUSE = 9;
+ public const int TYPE_BLOCK = 10;
+ public const int MODIFIERS = 11;
+ public const int VARIABLE_DEF = 12;
+ public const int METHOD_DEF = 13;
+ public const int NAMESPACE_DEF = 14;
+ public const int PARAMS = 15;
+ public const int PARAM = 16;
+ public const int TYPE_SPEC = 17;
+ public const int BLOCK = 18;
+ public const int EXPR = 19;
+ public const int ELIST = 20;
+ public const int EXPR_STMNT = 21;
+ public const int NEW_EXPR = 22;
+ public const int ENCPS_EXPR = 23;
+ public const int VAR_INIT = 24;
+ public const int METHOD_CALL = 25;
+ public const int ARRAY_ACC = 26;
+ public const int UNARY_PLUS = 27;
+ public const int UNARY_MINUS = 28;
+ public const int POST_INC = 29;
+ public const int POST_DEC = 30;
+ public const int ARRAY_LITERAL = 31;
+ public const int ELEMENT = 32;
+ public const int OBJECT_LITERAL = 33;
+ public const int OBJECT_FIELD = 34;
+ public const int FUNC_DEF = 35;
+ public const int FOR_INIT = 36;
+ public const int FOR_CONDITION = 37;
+ public const int FOR_ITERATOR = 38;
+ public const int LITERAL_package = 39;
+ public const int LCURLY = 40;
+ public const int SEMI = 41;
+ public const int RCURLY = 42;
+ public const int LITERAL_import = 43;
+ public const int LBRACK = 44;
+ public const int COMMA = 45;
+ public const int RBRACK = 46;
+ public const int LPAREN = 47;
+ public const int RPAREN = 48;
+ public const int LITERAL_class = 49;
+ public const int LITERAL_interface = 50;
+ public const int LITERAL_extends = 51;
+ public const int LITERAL_implements = 52;
+ public const int LITERAL_function = 53;
+ public const int LITERAL_get = 54;
+ public const int LITERAL_set = 55;
+ // "/n" = 56
+ // "/r" = 57
+ public const int IDENT = 58;
+ public const int LITERAL_namespace = 59;
+ public const int LITERAL_var = 60;
+ public const int LITERAL_const = 61;
+ public const int ASSIGN = 62;
+ public const int REST = 63;
+ public const int LITERAL_while = 64;
+ public const int LITERAL_do = 65;
+ public const int LITERAL_with = 66;
+ public const int LITERAL_if = 67;
+ public const int LITERAL_else = 68;
+ public const int LITERAL_throw = 69;
+ public const int LITERAL_return = 70;
+ public const int LITERAL_continue = 71;
+ public const int LITERAL_break = 72;
+ public const int LITERAL_switch = 73;
+ public const int LITERAL_case = 74;
+ public const int COLON = 75;
+ public const int LITERAL_default = 76;
+ public const int LITERAL_for = 77;
+ public const int LITERAL_each = 78;
+ public const int LITERAL_in = 79;
+ public const int DOT = 80;
+ public const int STAR = 81;
+ public const int LITERAL_public = 82;
+ public const int LITERAL_private = 83;
+ public const int LITERAL_protected = 84;
+ public const int LITERAL_internal = 85;
+ public const int LITERAL_static = 86;
+ public const int LITERAL_final = 87;
+ public const int LITERAL_enumerable = 88;
+ public const int LITERAL_explicit = 89;
+ public const int LITERAL_override = 90;
+ public const int LITERAL_dynamic = 91;
+ public const int NUMBER = 92;
+ public const int STAR_ASSIGN = 93;
+ public const int DIV_ASSIGN = 94;
+ public const int MOD_ASSIGN = 95;
+ public const int PLUS_ASSIGN = 96;
+ public const int MINUS_ASSIGN = 97;
+ public const int SL_ASSIGN = 98;
+ public const int SR_ASSIGN = 99;
+ public const int BSR_ASSIGN = 100;
+ public const int BAND_ASSIGN = 101;
+ public const int BXOR_ASSIGN = 102;
+ public const int BOR_ASSIGN = 103;
+ public const int LAND_ASSIGN = 104;
+ public const int LOR_ASSIGN = 105;
+ public const int QUESTION = 106;
+ public const int LOR = 107;
+ public const int LAND = 108;
+ public const int BOR = 109;
+ public const int BXOR = 110;
+ public const int BAND = 111;
+ public const int STRICT_EQUAL = 112;
+ public const int STRICT_NOT_EQUAL = 113;
+ public const int NOT_EQUAL = 114;
+ public const int EQUAL = 115;
+ public const int LWT = 116;
+ public const int GT = 117;
+ public const int LE = 118;
+ public const int GE = 119;
+ public const int LITERAL_is = 120;
+ public const int LITERAL_as = 121;
+ public const int SL = 122;
+ public const int SR = 123;
+ public const int BSR = 124;
+ public const int PLUS = 125;
+ public const int MINUS = 126;
+ public const int DIV = 127;
+ public const int MOD = 128;
+ public const int INC = 129;
+ public const int DEC = 130;
+ public const int LITERAL_delete = 131;
+ public const int LITERAL_typeof = 132;
+ public const int LNOT = 133;
+ public const int BNOT = 134;
+ public const int E4X_DESC = 135;
+ public const int E4X_ATTRI = 136;
+ public const int LITERAL_null = 137;
+ public const int LITERAL_true = 138;
+ public const int LITERAL_false = 139;
+ public const int LITERAL_undefined = 140;
+ public const int STRING_LITERAL = 141;
+ public const int REGEX_LITERAL = 142;
+ public const int XML_LITERAL = 143;
+ public const int LITERAL_new = 144;
+ public const int DBL_COLON = 145;
+ public const int XML_ATTRIBUTE = 146;
+ public const int XML_BINDING = 147;
+ public const int XML_AS3_EXPRESSION = 148;
+ public const int XML_TEXTNODE = 149;
+ public const int XML_COMMENT = 150;
+ public const int XML_CDATA = 151;
+ public const int REGEX_BODY = 152;
+ public const int WS = 153;
+ public const int NL = 154;
+ public const int BOM = 155;
+ public const int SL_COMMENT = 156;
+ public const int ML_COMMENT = 157;
+ public const int EXPONENT = 158;
+ public const int HEX_DIGIT = 159;
+ public const int ESC = 160;
+
+ }
}
diff --git a/External/Plugins/AS3Context/MxmlComplete.cs b/External/Plugins/AS3Context/MxmlComplete.cs
index 5cbd704ca9..0506b3edd4 100644
--- a/External/Plugins/AS3Context/MxmlComplete.cs
+++ b/External/Plugins/AS3Context/MxmlComplete.cs
@@ -1,28 +1,32 @@
using System;
using System.Collections.Generic;
+using System.Diagnostics;
+using System.Drawing;
+using System.IO;
using System.Text;
-using XMLCompletion;
-using ASCompletion.Model;
+using System.Text.RegularExpressions;
+using ASCompletion;
using ASCompletion.Completion;
+using ASCompletion.Context;
+using ASCompletion.Model;
using PluginCore;
using PluginCore.Controls;
-using System.Text.RegularExpressions;
-using System.IO;
using PluginCore.Helpers;
+using XMLCompletion;
namespace AS3Context
{
class MxmlComplete
{
- static public bool IsDirty;
- static public Context context;
- static public MxmlFilterContext mxmlContext;
+ public static bool IsDirty;
+ public static Context context;
+ public static MxmlFilterContext mxmlContext;
#region shortcuts
public static bool GotoDeclaration()
{
- ScintillaNet.ScintillaControl sci = PluginBase.MainForm.CurrentDocument.SciControl;
- if (sci == null) return false;
+ var sci = PluginBase.MainForm.CurrentDocument?.SciControl;
+ if (sci is null) return false;
if (sci.ConfigurationLanguage != "xml") return false;
int pos = sci.CurrentPos;
@@ -33,13 +37,11 @@ public static bool GotoDeclaration()
if (c <= 32 || c == '/' || c == '>') break;
pos ++;
}
- XMLContextTag ctag = XMLComplete.GetXMLContextTag(sci, pos);
- if (ctag.Name == null) return true;
+ var ctag = XMLComplete.GetXMLContextTag(sci, pos);
+ if (ctag.Name is null) return true;
string word = sci.GetWordFromPosition(sci.CurrentPos);
-
string type = ResolveType(mxmlContext, ctag.Name);
- ClassModel model = context.ResolveType(type, mxmlContext.model);
-
+ var model = context.ResolveType(type, mxmlContext.model);
if (model.IsVoid()) // try resolving tag as member of parent tag
{
parentTag = XMLComplete.GetParentTag(sci, ctag);
@@ -53,16 +55,14 @@ public static bool GotoDeclaration()
else return true;
}
- if (!ctag.Name.EndsWith(word))
+ if (word != null && !ctag.Name.EndsWithOrdinal(word))
{
- ASResult found = ResolveAttribute(model, word);
+ var found = ResolveAttribute(model, word);
ASComplete.OpenDocumentToDeclaration(sci, found);
}
else
{
- ASResult found = new ASResult();
- found.InFile = model.InFile;
- found.Type = model;
+ var found = new ASResult {InFile = model.InFile, Type = model};
ASComplete.OpenDocumentToDeclaration(sci, found);
}
return true;
@@ -70,21 +70,23 @@ public static bool GotoDeclaration()
#endregion
#region tag completion
- static private XMLContextTag tagContext;
- static private XMLContextTag parentTag;
- static private string tokenContext;
- static private string checksum;
- static private Dictionary> allTags;
+
+ static XMLContextTag tagContext;
+ static XMLContextTag parentTag;
+ static string tokenContext;
+ static string checksum;
+
+ static Dictionary> allTags;
//static private Regex reIncPath = new Regex("[\"']([^\"']+)", RegexOptions.Compiled);
- static private Regex reIncPath = new Regex("(\"|')([^\r\n]+)(\\1)", RegexOptions.Compiled);
- static private Dictionary includesCache = new Dictionary();
+ static readonly Regex reIncPath = new Regex("(\"|')([^\r\n]+)(\\1)", RegexOptions.Compiled);
+ static readonly Dictionary includesCache = new Dictionary();
///
/// Called
///
///
///
- static public bool HandleElement(object data)
+ public static bool HandleElement(object data)
{
if (!GetContext(data)) return false;
@@ -97,19 +99,19 @@ static public bool HandleElement(object data)
bool isContainer = AddParentAttributes(mix, excludes); // current tag attributes
if (isContainer) // container children tag
- foreach (string ns in mxmlContext.namespaces.Keys)
- {
- string uri = mxmlContext.namespaces[ns];
- if (ns != "*") mix.Add(new NamespaceItem(ns, uri));
-
- if (!allTags.ContainsKey(ns))
- continue;
- foreach (string tag in allTags[ns])
+ foreach (string ns in mxmlContext.namespaces.Keys)
{
- if (ns == "*") mix.Add(new HtmlTagItem(tag, tag));
- else mix.Add(new HtmlTagItem(tag, ns + ":" + tag, uri));
+ string uri = mxmlContext.namespaces[ns];
+ if (ns != "*") mix.Add(new NamespaceItem(ns, uri));
+
+ if (!allTags.ContainsKey(ns))
+ continue;
+ foreach (string tag in allTags[ns])
+ {
+ if (ns == "*") mix.Add(new HtmlTagItem(tag, tag));
+ else mix.Add(new HtmlTagItem(tag, ns + ":" + tag, uri));
+ }
}
- }
// cleanup and show list
mix.Sort(new MXMLListItemComparer());
@@ -130,7 +132,7 @@ static public bool HandleElement(object data)
return true;
}
- private static bool AddParentAttributes(List mix, List excludes)
+ static bool AddParentAttributes(List mix, List excludes)
{
bool isContainer = true;
if (parentTag.Name != null) // add parent tag members
@@ -142,8 +144,8 @@ private static bool AddParentAttributes(List mix, List mix, List mix = new List();
- List excludes = new List();
-
- bool isContainer = AddParentAttributes(mix, excludes); // current tag attributes
-
+ var ns = tagContext.Name.Substring(0, p);
+ if (!mxmlContext.namespaces.ContainsKey(ns)) return true;
+ var uri = mxmlContext.namespaces[ns];
+ var mix = new List();
+ var excludes = new List();
+ var isContainer = AddParentAttributes(mix, excludes); // current tag attributes
if (isContainer && allTags.ContainsKey(ns)) // container children tags
foreach (string tag in allTags[ns])
mix.Add(new HtmlTagItem(tag, ns + ":" + tag, uri));
// cleanup and show list
mix.Sort(new MXMLListItemComparer());
- List items = new List();
+ var items = new List();
string previous = null;
- foreach (ICompletionListItem item in mix)
+ foreach (var item in mix)
{
if (previous == item.Label) continue;
previous = item.Label;
@@ -193,31 +189,29 @@ static public bool HandleNamespace(object data)
return true;
}
- static public bool HandleElementClose(object data)
+ public static bool HandleElementClose(object data)
{
if (!GetContext(data)) return false;
-
if (tagContext.Closing) return false;
-
- string type = ResolveType(mxmlContext, tagContext.Name);
- ScintillaNet.ScintillaControl sci = PluginBase.MainForm.CurrentDocument.SciControl;
-
- if (type.StartsWith("mx.builtin.") || type.StartsWith("fx.builtin.")) // special tags
+ var sci = PluginBase.MainForm.CurrentDocument?.SciControl;
+ if (sci is null) return false;
+ var type = ResolveType(mxmlContext, tagContext.Name);
+ if (type.StartsWithOrdinal("mx.builtin.") || type.StartsWithOrdinal("fx.builtin.")) // special tags
{
- if (type.EndsWith(".Script"))
+ if (type.EndsWithOrdinal(".Script"))
{
string snip = "$(Boundary)\n\t\n" + tagContext.Name + ">";
SnippetHelper.InsertSnippetText(sci, sci.CurrentPos, snip);
return true;
}
- if (type.EndsWith(".Style"))
+ if (type.EndsWithOrdinal(".Style"))
{
string snip = "$(Boundary)";
foreach (string ns in mxmlContext.namespaces.Keys)
{
string uri = mxmlContext.namespaces[ns];
if (ns != "fx")
- snip += String.Format("\n\t@namespace {0} \"{1}\";", ns, uri);
+ snip += $"\n\t@namespace {ns} \"{uri}\";";
}
snip += "\n\t$(EntryPoint)\n" + tagContext.Name + ">";
SnippetHelper.InsertSnippetText(sci, sci.CurrentPos, snip);
@@ -227,30 +221,80 @@ static public bool HandleElementClose(object data)
return false;
}
- static public bool HandleAttribute(object data)
+ public static bool HandleAttribute(object data)
{
if (!GetContext(data)) return false;
-
- string type = ResolveType(mxmlContext, tagContext.Name);
- ClassModel tagClass = context.ResolveType(type, mxmlContext.model);
+ var type = ResolveType(mxmlContext, tagContext.Name);
+ var tagClass = context.ResolveType(type, mxmlContext.model);
if (tagClass.IsVoid()) return true;
tagClass.ResolveExtends();
-
- List mix = new List();
- List excludes = new List();
+ var mix = new List();
+ var excludes = new List();
GetTagAttributes(tagClass, mix, excludes, null);
// cleanup and show list
mix.Sort(new MXMLListItemComparer());
- List items = new List();
+ var items = new List();
string previous = null;
- foreach (ICompletionListItem item in mix)
+ foreach (var item in mix)
{
if (previous == item.Label) continue;
previous = item.Label;
if (excludes.Contains(previous)) continue;
items.Add(item);
}
+ if (items.Count == 0) return true;
+ if (!string.IsNullOrEmpty(tokenContext)) CompletionList.Show(items, false, tokenContext);
+ else CompletionList.Show(items, true);
+ CompletionList.MinWordLength = 0;
+ return true;
+ }
+
+ public static bool HandleAttributeValue(object data)
+ {
+ if (!GetContext(data)) return false;
+ var type = ResolveType(mxmlContext, tagContext.Name);
+ var tagClass = context.ResolveType(type, mxmlContext.model);
+ if (tagClass.IsVoid()) return true;
+ tagClass.ResolveExtends();
+ var caBuilder = new StringBuilder();
+ bool possibleStartFound = false, startFound = false;
+ for (int i = tagContext.Tag.Length - 1; i >= 0; i--)
+ {
+ char currChar = tagContext.Tag[i];
+ if (currChar == '=')
+ {
+ possibleStartFound = true;
+ }
+ else if (startFound)
+ {
+ if (char.IsWhiteSpace(currChar))
+ break;
+
+ caBuilder.Insert(0, currChar);
+ }
+ else if (possibleStartFound && !char.IsWhiteSpace(currChar))
+ {
+ startFound = true;
+ caBuilder.Insert(0, currChar);
+ }
+ }
+
+ var currentAttribute = caBuilder.ToString();
+
+ var mix = GetTagAttributeValues(tagClass, null, currentAttribute);
+ if (mix.IsNullOrEmpty()) return true;
+
+ // cleanup and show list
+ mix.Sort(new MXMLListItemComparer());
+ var items = new List();
+ string previous = null;
+ foreach (var item in mix)
+ {
+ if (previous == item.Label) continue;
+ previous = item.Label;
+ items.Add(item);
+ }
if (items.Count == 0) return true;
if (!string.IsNullOrEmpty(tokenContext)) CompletionList.Show(items, false, tokenContext);
@@ -259,13 +303,13 @@ static public bool HandleAttribute(object data)
return true;
}
- private static bool GetTagAttributes(ClassModel tagClass, List mix, List excludes, string ns)
+ static bool GetTagAttributes(ClassModel tagClass, ICollection mix, ICollection excludes, string ns)
{
- ClassModel curClass = mxmlContext.model.GetPublicClass();
- ClassModel tmpClass = tagClass;
- FlagType mask = FlagType.Variable | FlagType.Setter;
- Visibility acc = context.TypesAffinity(curClass, tmpClass);
- bool isContainer = false;
+ var curClass = mxmlContext.model.GetPublicClass();
+ var tmpClass = tagClass;
+ var mask = FlagType.Variable | FlagType.Setter;
+ var acc = context.TypesAffinity(curClass, tmpClass);
+ var isContainer = false;
if (tmpClass.InFile.Package != "mx.builtin" && tmpClass.InFile.Package != "fx.builtin")
mix.Add(new HtmlAttributeItem("id", "String", null, ns));
@@ -275,11 +319,16 @@ private static bool GetTagAttributes(ClassModel tagClass, List 0 && (member.Flags & mask) > 0
@@ -289,17 +338,15 @@ private static bool GetTagAttributes(ClassModel tagClass, List 0)
{
- if (member.Parameters != null && member.Parameters.Count > 0)
- mtype = member.Parameters[0].Type;
- else mtype = null;
+ mtype = !member.Parameters.IsNullOrEmpty() ? member.Parameters[0].Type : null;
}
mix.Add(new HtmlAttributeItem(member.Name, mtype, className, ns));
}
- ExploreMetadatas(tmpClass.InFile, mix, excludes, ns);
+ ExploreMetadatas(tmpClass, mix, excludes, ns, tagClass == tmpClass);
tmpClass = tmpClass.Extends;
- if (tmpClass != null && tmpClass.InFile.Package == "" && tmpClass.Name == "Object")
+ if (tmpClass.InFile.Package == "" && tmpClass.Name == "Object")
break;
// members visibility
acc = context.TypesAffinity(curClass, tmpClass);
@@ -308,22 +355,271 @@ private static bool GetTagAttributes(ClassModel tagClass, List mix, List excludes, string ns)
+ static List