Ejemplo n.º 1
0
 public Types.CompileTargetType DetermineTargetType(DocumentInfo Doc, Parser.ParserBase Parser)
 {
     // compile target
     Types.CompileTargetType compileTarget = C64Studio.Types.CompileTargetType.NONE;
     if (Doc.Element != null)
     {
         compileTarget = Doc.Element.TargetType;
     }
     if (compileTarget == C64Studio.Types.CompileTargetType.NONE)
     {
         compileTarget = Parser.CompileTarget;
     }
     return(compileTarget);
 }
Ejemplo n.º 2
0
        protected override bool ProcessTask()
        {
            Core.SetStatus("Building...");
            Core.ClearOutput();
            Core.Compiling.m_RebuiltFiles.Clear();
            Core.Compiling.m_RebuiltBuildConfigFiles.Clear();
            Core.Compiling.m_BuildChainStack.Clear();
            bool needsRebuild = Core.Compiling.NeedsRebuild(m_DocumentToBuild);

            if (needsRebuild)
            {
                Core.Compiling.m_BuildIsCurrent = false;
                if (m_DocumentToBuild.Project != null)
                {
                    if (!Core.MainForm.SaveProject(m_DocumentToBuild.Project))
                    {
                        Core.SetStatus("Failed to save project");
                        Core.MainForm.AppState = Types.StudioState.NORMAL;
                        return(false);
                    }
                }
                Core.MainForm.SaveAllDocuments();
                if (m_DocumentToBuild.Project != null)
                {
                    if (!Core.MainForm.SaveProject(m_DocumentToBuild.Project))
                    {
                        Core.SetStatus("Failed to save project");
                        Core.MainForm.AppState = Types.StudioState.NORMAL;
                        return(false);
                    }
                }
            }

            DocumentInfo baseDoc = m_DocumentToBuild;

            if (baseDoc == null)
            {
                Core.SetStatus("No active document");
                Core.MainForm.AppState = Types.StudioState.NORMAL;
                return(false);
            }
            if ((baseDoc.Element == null) &&
                (!baseDoc.Compilable))
            {
                Core.AddToOutput("Document is not part of project, cannot build" + System.Environment.NewLine);
                Core.SetStatus("Document is not part of project, cannot build");
                Core.MainForm.AppState = Types.StudioState.NORMAL;
                return(false);
            }
            Core.AddToOutput("Determined " + baseDoc.DocumentFilename + " as active document" + System.Environment.NewLine);

            Types.BuildInfo buildInfo = new C64Studio.Types.BuildInfo();
            if (!Core.Compiling.m_BuildIsCurrent)
            {
                C64Studio.Types.ASM.FileInfo dummyInfo;

                string configSetting = null;
                if (baseDoc.Project != null)
                {
                    configSetting = baseDoc.Project.Settings.CurrentConfig.Name;
                }

                if (!BuildElement(baseDoc, configSetting, null, true, out buildInfo, out dummyInfo))
                {
                    Core.SetStatus("Build failed");
                    Core.MainForm.AppState = Types.StudioState.NORMAL;
                    return(false);
                }

                Core.Compiling.m_LastBuildInfo  = buildInfo;
                Core.Compiling.m_BuildIsCurrent = true;
            }
            else
            {
                if (baseDoc.Element != null)
                {
                    buildInfo.TargetType = baseDoc.Element.TargetType;
                }
                else
                {
                    buildInfo = Core.Compiling.m_LastBuildInfo;
                }
                if (buildInfo.TargetType == C64Studio.Types.CompileTargetType.NONE)
                {
                    buildInfo.TargetType = Core.Compiling.m_LastBuildInfo.TargetType;
                }

                Core.AddToOutput("Build is current" + System.Environment.NewLine);
            }
            if (Core.Navigating.DetermineASMFileInfo(baseDoc) == Core.Navigating.DetermineASMFileInfo(m_ActiveDocument))
            {
                //Debug.Log( "m_Outline.RefreshFromDocument after compile" );
                Core.MainForm.m_Outline.RefreshFromDocument(baseDoc.BaseDoc);
            }
            Core.SetStatus("Build successful");

            switch (Core.MainForm.AppState)
            {
            case Types.StudioState.COMPILE:
            case Types.StudioState.BUILD:
            case StudioState.BUILD_PRE_PROCESSED_FILE:
                Core.MainForm.AppState = Types.StudioState.NORMAL;
                if (Core.Settings.PlaySoundOnSuccessfulBuild)
                {
                    System.Media.SystemSounds.Asterisk.Play();
                }
                break;

            case Types.StudioState.BUILD_AND_RUN:
                // run program
            {
                Types.CompileTargetType targetType = buildInfo.TargetType;
                if (m_DocumentToRun.Element != null)
                {
                    if (m_DocumentToRun.Element.TargetType != C64Studio.Types.CompileTargetType.NONE)
                    {
                        targetType = m_DocumentToRun.Element.TargetType;
                    }
                    ProjectElement.PerConfigSettings configSetting = m_DocumentToRun.Element.Settings[m_DocumentToRun.Project.Settings.CurrentConfig.Name];
                    if (!string.IsNullOrEmpty(configSetting.DebugFile))
                    {
                        targetType = configSetting.DebugFileType;
                    }
                }
                if (!Core.MainForm.RunCompiledFile(m_DocumentToRun, targetType))
                {
                    Core.MainForm.AppState = Types.StudioState.NORMAL;
                    return(false);
                }
            }
            break;

            case Types.StudioState.BUILD_AND_DEBUG:
                // run program
                if (!Core.Debugging.DebugCompiledFile(m_DocumentToDebug, m_DocumentToRun))
                {
                    Core.MainForm.AppState = Types.StudioState.NORMAL;
                    return(false);
                }
                break;

            default:
                Core.MainForm.AppState = Types.StudioState.NORMAL;
                break;
            }

            return(true);
        }
Ejemplo n.º 3
0
        protected override bool ProcessTask()
        {
            Core.SetStatus("Building...");
            Core.ClearOutput();
            Core.Compiling.m_RebuiltFiles.Clear();
            Core.Compiling.m_RebuiltBuildConfigFiles.Clear();
            Core.Compiling.m_BuildChainStack.Clear();
            bool needsRebuild = Core.Compiling.NeedsRebuild(m_DocumentToBuild);

            if (needsRebuild)
            {
                Core.Compiling.m_BuildIsCurrent = false;
                if (m_DocumentToBuild.Project != null)
                {
                    if (!Core.MainForm.SaveProject(m_DocumentToBuild.Project))
                    {
                        Core.SetStatus("Failed to save project");
                        Core.MainForm.AppState = Types.StudioState.NORMAL;
                        return(false);
                    }
                }
                Core.MainForm.SaveAllDocuments();
                if (m_DocumentToBuild.Project != null)
                {
                    if (!Core.MainForm.SaveProject(m_DocumentToBuild.Project))
                    {
                        Core.SetStatus("Failed to save project");
                        Core.MainForm.AppState = Types.StudioState.NORMAL;
                        return(false);
                    }
                }
            }

            DocumentInfo baseDoc = m_DocumentToBuild;

            if (baseDoc == null)
            {
                Core.SetStatus("No active document");
                Core.MainForm.AppState = Types.StudioState.NORMAL;
                return(false);
            }
            if ((baseDoc.Element == null) &&
                (!baseDoc.Compilable))
            {
                Core.AddToOutput("Document is not part of project, cannot build" + System.Environment.NewLine);
                Core.SetStatus("Document is not part of project, cannot build");
                Core.MainForm.AppState = Types.StudioState.NORMAL;
                return(false);
            }
            Core.AddToOutput("Determined " + baseDoc.DocumentFilename + " as active document" + System.Environment.NewLine);

            var buildInfo = new SingleBuildInfo();

            SingleBuildInfo buildInfoFromLastBuildOfThisFile = null;

            //Core.Compiling.m_LastBuildInfo.TryGetValue( baseDoc.FullPath, out buildInfoFromLastBuildOfThisFile );
            buildInfoFromLastBuildOfThisFile = baseDoc.LastBuildInfo;

            if ((buildInfoFromLastBuildOfThisFile != null) &&
                ((!System.IO.File.Exists(buildInfoFromLastBuildOfThisFile.TargetFile)) ||
                 (buildInfoFromLastBuildOfThisFile.TimeStampOfTargetFile != Core.Compiling.FileLastWriteTime(buildInfoFromLastBuildOfThisFile.TargetFile))))
            {
                Core.AddToOutput($"Target file {buildInfoFromLastBuildOfThisFile.TargetFile} was modified or is missing" + System.Environment.NewLine);
                Core.Compiling.m_BuildIsCurrent = false;
            }

            if (!Core.Compiling.m_BuildIsCurrent)
            {
                RetroDevStudio.Types.ASM.FileInfo dummyInfo;

                string configSetting = null;
                if (baseDoc.Project != null)
                {
                    configSetting = baseDoc.Project.Settings.CurrentConfig.Name;
                }

                if (!BuildElement(baseDoc, configSetting, null, true, out buildInfo, out dummyInfo))
                {
                    Core.SetStatus("Build failed");
                    Core.MainForm.AppState = Types.StudioState.NORMAL;
                    return(false);
                }

                Core.Compiling.m_LastBuildInfo[baseDoc.FullPath] = buildInfo;
                Core.Compiling.m_BuildIsCurrent = true;
            }
            else
            {
                if (baseDoc.Element != null)
                {
                    buildInfo.TargetType = baseDoc.Element.TargetType;
                }
                else
                {
                    buildInfo = Core.Compiling.m_LastBuildInfo[baseDoc.FullPath];
                }
                if (buildInfo.TargetType == RetroDevStudio.Types.CompileTargetType.NONE)
                {
                    buildInfo.TargetType = Core.Compiling.m_LastBuildInfo[baseDoc.FullPath].TargetType;
                }
                Core.AddToOutput("Build is current" + System.Environment.NewLine);
            }
            if (Core.Navigating.DetermineASMFileInfo(baseDoc) == Core.Navigating.DetermineASMFileInfo(m_ActiveDocument))
            {
                //Debug.Log( "m_Outline.RefreshFromDocument after compile" );
                Core.MainForm.m_Outline.RefreshFromDocument(baseDoc.BaseDoc);
            }
            Core.SetStatus("Build successful");

            switch (Core.MainForm.AppState)
            {
            case StudioState.COMPILE:
            case StudioState.BUILD:
            case StudioState.BUILD_PRE_PROCESSED_FILE:
            case StudioState.BUILD_RELOCATION_FILE:
                if (Core.Settings.PlaySoundOnSuccessfulBuild)
                {
                    System.Media.SystemSounds.Asterisk.Play();

                    if (Core.MainForm.AppState == StudioState.BUILD_PRE_PROCESSED_FILE)
                    {
                        Core.MainForm.AppState = Types.StudioState.NORMAL;

                        string pathLog = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(m_DocumentToBuild.FullPath), System.IO.Path.GetFileNameWithoutExtension(m_DocumentToBuild.FullPath) + ".dump");
                        Core.Navigating.OpenDocumentAndGotoLine(null, Core.Navigating.FindDocumentInfoByPath(pathLog), 0);
                    }
                    else if (Core.MainForm.AppState == StudioState.BUILD_RELOCATION_FILE)
                    {
                        Core.MainForm.AppState = Types.StudioState.NORMAL;

                        string pathLog = System.IO.Path.Combine(System.IO.Path.GetDirectoryName(m_DocumentToBuild.FullPath), System.IO.Path.GetFileNameWithoutExtension(m_DocumentToBuild.FullPath) + ".loc");
                        Core.Navigating.OpenDocumentAndGotoLine(null, Core.Navigating.FindDocumentInfoByPath(pathLog), 0);
                    }
                }
                Core.MainForm.AppState = Types.StudioState.NORMAL;
                break;

            case Types.StudioState.BUILD_AND_RUN:
                // run program
            {
                Types.CompileTargetType targetType = buildInfo.TargetType;
                if (m_DocumentToRun.Element != null)
                {
                    if (m_DocumentToRun.Element.TargetType != RetroDevStudio.Types.CompileTargetType.NONE)
                    {
                        targetType = m_DocumentToRun.Element.TargetType;
                    }
                    ProjectElement.PerConfigSettings configSetting = m_DocumentToRun.Element.Settings[m_DocumentToRun.Project.Settings.CurrentConfig.Name];
                    if (!string.IsNullOrEmpty(configSetting.DebugFile))
                    {
                        targetType = configSetting.DebugFileType;
                    }
                }
                if (!Core.MainForm.RunCompiledFile(m_DocumentToRun, targetType))
                {
                    Core.MainForm.AppState = Types.StudioState.NORMAL;
                    return(false);
                }
            }
            break;

            case Types.StudioState.BUILD_AND_DEBUG:
                // run program
                if (!Core.Debugging.DebugCompiledFile(m_DocumentToDebug, m_DocumentToRun))
                {
                    Core.MainForm.AppState = Types.StudioState.NORMAL;
                    return(false);
                }
                break;

            default:
                Core.MainForm.AppState = Types.StudioState.NORMAL;
                break;
            }

            return(true);
        }
Ejemplo n.º 4
0
        public bool DebugCompiledFile(DocumentInfo DocumentToDebug, DocumentInfo DocumentToRun)
        {
            if (DocumentToDebug == null)
            {
                Core.AddToOutput("Debug document not found, this is an internal error!");
                return(false);
            }

            if (DocumentToDebug.Element == null)
            {
                Core.AddToOutput("Debugging " + DocumentToDebug.DocumentFilename + System.Environment.NewLine);
            }
            else
            {
                Core.AddToOutput("Debugging " + DocumentToDebug.Element.Name + System.Environment.NewLine);
            }

            ToolInfo toolRun = Core.DetermineTool(DocumentToRun, true);

            if (toolRun == null)
            {
                System.Windows.Forms.MessageBox.Show("No emulator tool has been configured yet!", "Missing emulator tool");
                Core.AddToOutput("There is no emulator tool configured!");
                return(false);
            }

            SetupDebugger(toolRun);

            if (!Debugger.CheckEmulatorVersion(toolRun))
            {
                return(false);
            }

            DebuggedASMBase      = DocumentToDebug;
            DebugBaseDocumentRun = DocumentToRun;

            Core.MainForm.m_DebugWatch.ReseatWatches(DocumentToDebug.ASMFileInfo);
            Debugger.ClearCaches();
            MemoryViews.ForEach(mv => mv.MarkAllMemoryAsUnknown());
            ReseatBreakpoints(DocumentToDebug.ASMFileInfo);
            AddVirtualBreakpoints(DocumentToDebug.ASMFileInfo);
            Debugger.ClearAllBreakpoints();
            MarkedDocument     = null;
            MarkedDocumentLine = -1;

            if (!Core.Executing.PrepareStartProcess(toolRun, DocumentToRun))
            {
                return(false);
            }
            if (!System.IO.Directory.Exists(Core.Executing.RunProcess.StartInfo.WorkingDirectory.Trim(new char[] { '"' })))
            {
                Core.AddToOutput("The determined working directory " + Core.Executing.RunProcess.StartInfo.WorkingDirectory + " does not exist" + System.Environment.NewLine);
                return(false);
            }

            // determine debug target type
            Types.CompileTargetType targetType = RetroDevStudio.Types.CompileTargetType.NONE;
            if (DocumentToRun.Element != null)
            {
                targetType = DocumentToRun.Element.TargetType;
            }

            string fileToRun = "";

            if (DocumentToRun.Element != null)
            {
                fileToRun = DocumentToRun.Element.TargetFilename;
                ProjectElement.PerConfigSettings configSetting = DocumentToRun.Element.Settings[DocumentToRun.Project.Settings.CurrentConfig.Name];
                if (!string.IsNullOrEmpty(configSetting.DebugFile))
                {
                    targetType = configSetting.DebugFileType;
                }
            }

            if (targetType == RetroDevStudio.Types.CompileTargetType.NONE)
            {
                var lastBuildInfoOfThisFile = Core.Compiling.m_LastBuildInfo[DocumentToRun.FullPath];

                targetType = lastBuildInfoOfThisFile.TargetType;
            }
            DebugType = targetType;

            string breakPointFile = PrepareAfterStartBreakPoints();
            string command        = toolRun.DebugArguments;

            if (Parser.ASMFileParser.IsCartridge(targetType))
            {
                command = command.Replace("-initbreak 0x$(DebugStartAddressHex) ", "");
            }

            if ((toolRun.PassLabelsToEmulator) &&
                (DebuggedASMBase.ASMFileInfo != null))
            {
                breakPointFile += DebuggedASMBase.ASMFileInfo.LabelsAsFile(EmulatorInfo.LabelFormat(toolRun));
            }

            if (breakPointFile.Length > 0)
            {
                try
                {
                    TempDebuggerStartupFilename = System.IO.Path.GetTempFileName();
                    System.IO.File.WriteAllText(TempDebuggerStartupFilename, breakPointFile);
                    command += " -moncommands \"" + TempDebuggerStartupFilename + "\"";
                }
                catch (System.IO.IOException ioe)
                {
                    System.Windows.Forms.MessageBox.Show(ioe.Message, "Error writing temporary file");
                    Core.AddToOutput("Error writing temporary file");
                    TempDebuggerStartupFilename = "";
                    return(false);
                }
            }

            //ParserASM.CompileTarget != Types.CompileTargetType.NONE ) ? ParserASM.CompileTarget : DocumentToRun.Element.TargetType;

            // need to adjust initial breakpoint address for late added store/load breakpoints?

            InitialBreakpointIsTemporary = true;
            //if ( BreakpointsToAddAfterStartup.Count > 0 )
            {
                // yes
                LateBreakpointOverrideDebugStart = OverrideDebugStart;

                // special start addresses for different run types
                if (Parser.ASMFileParser.IsCartridge(targetType))
                {
                    OverrideDebugStart = Debugger.ConnectedMachine.InitialBreakpointAddressCartridge;
                }
                else
                {
                    // directly after calling load from ram (as VICE does when autostarting a .prg file)
                    // TODO - check with .t64, .tap, .d64
                    OverrideDebugStart = Debugger.ConnectedMachine.InitialBreakpointAddress;
                }
            }
            if ((DocumentToDebug.Project != null) &&
                (LateBreakpointOverrideDebugStart == -1) &&
                (!string.IsNullOrEmpty(DocumentToDebug.Project.Settings.CurrentConfig.DebugStartAddressLabel)))
            {
                int debugStartAddress = -1;
                if (!Core.MainForm.DetermineDebugStartAddress(DocumentToDebug, DocumentToDebug.Project.Settings.CurrentConfig.DebugStartAddressLabel, out debugStartAddress))
                {
                    Core.AddToOutput("Cannot determine value for debug start address from '" + DocumentToDebug.Project.Settings.CurrentConfig.DebugStartAddressLabel + "'" + System.Environment.NewLine);
                    return(false);
                }
                if (debugStartAddress != 0)
                {
                    InitialBreakpointIsTemporary     = false;
                    OverrideDebugStart               = debugStartAddress;
                    LateBreakpointOverrideDebugStart = debugStartAddress;
                }
            }

            if (Core.Settings.TrueDriveEnabled)
            {
                command = toolRun.TrueDriveOnArguments + " " + command;
            }
            else
            {
                command = toolRun.TrueDriveOffArguments + " " + command;
            }

            bool error = false;

            Core.Executing.RunProcess.StartInfo.Arguments = Core.MainForm.FillParameters(command, DocumentToRun, true, out error);
            if (error)
            {
                return(false);
            }

            if (Parser.ASMFileParser.IsCartridge(targetType))
            {
                Core.Executing.RunProcess.StartInfo.Arguments += " " + Core.MainForm.FillParameters(toolRun.CartArguments, DocumentToRun, true, out error);
            }
            else
            {
                Core.Executing.RunProcess.StartInfo.Arguments += " " + Core.MainForm.FillParameters(toolRun.PRGArguments, DocumentToRun, true, out error);
            }
            if (error)
            {
                return(false);
            }

            Core.AddToOutput("Calling " + Core.Executing.RunProcess.StartInfo.FileName + " with " + Core.Executing.RunProcess.StartInfo.Arguments + System.Environment.NewLine);
            Core.Executing.RunProcess.Exited += new EventHandler(Core.MainForm.runProcess_Exited);
            Core.SetStatus("Running...");

            Core.MainForm.SetGUIForWaitOnExternalTool(true);

            if (Core.Executing.RunProcess.Start())
            {
                DateTime current = DateTime.Now;

                // new GTK VICE opens up with console window (yuck) which nicely interferes with WaitForInputIdle -> give it 5 seconds to open main window
                bool waitForInputIdleFailed = false;
                try
                {
                    Core.Executing.RunProcess.WaitForInputIdle(5000);
                }
                catch (Exception ex)
                {
                    Debug.Log("WaitForInputIdle failed: " + ex.ToString());
                    waitForInputIdleFailed = true;
                }

                // only connect with debugger if VICE
                int numConnectionAttempts = 1;
                if ((string.IsNullOrEmpty(Core.Executing.RunProcess.MainWindowTitle)) &&
                    (waitForInputIdleFailed))
                {
                    // assume GTK VICE
                    numConnectionAttempts = 10;
                }
                if (EmulatorInfo.SupportsDebugging(toolRun))
                {
                    //Debug.Log( "Have " + numConnectionAttempts + " attempts" );
                    Core.AddToOutput("Connection attempt ");
                    for (int i = 0; i < numConnectionAttempts; ++i)
                    {
                        //Debug.Log( "attempt" + i );
                        Core.AddToOutput((i + 1).ToString());
                        if (Debugger.ConnectToEmulator(Parser.ASMFileParser.IsCartridge(targetType)))
                        {
                            //Debug.Log( "-succeeded" );
                            Core.AddToOutput(" succeeded" + System.Environment.NewLine);
                            Core.MainForm.m_CurrentActiveTool = toolRun;
                            DebuggedProject        = DocumentToRun.Project;
                            Core.MainForm.AppState = Types.StudioState.DEBUGGING_RUN;
                            Core.MainForm.SetGUIForDebugging(true);
                            break;
                        }
                        // wait a second
                        for (int j = 0; j < 20; ++j)
                        {
                            System.Threading.Thread.Sleep(50);
                            System.Windows.Forms.Application.DoEvents();
                        }
                    }
                    if (Core.MainForm.AppState != Types.StudioState.DEBUGGING_RUN)
                    {
                        Core.AddToOutput("failed " + numConnectionAttempts + " times, giving up" + System.Environment.NewLine);
                        return(false);
                    }
                }
                else
                {
                    Core.MainForm.m_CurrentActiveTool = toolRun;
                    DebuggedProject        = DocumentToRun.Project;
                    Core.MainForm.AppState = Types.StudioState.DEBUGGING_RUN;
                    Core.MainForm.SetGUIForDebugging(true);
                }
            }
            return(true);
        }
Ejemplo n.º 5
0
        public void SetAssemblerType(Types.AssemblerType Type)
        {
            // set default settings
            AllowedSingleTokens = "";
            AllowedTokenChars.Clear();
            AllowedTokenEndChars.Clear();
            AllowedTokenStartChars.Clear();
            DefineSeparatorKeywords.Clear();
            PseudoOps.Clear();
            StatementSeparatorChars.Clear();
            POPrefix     = "";
            LabelPostfix = "";
            MacroFunctionCallPrefix.Clear();
            MacroIsZone = false;
            MacrosHaveVariableNumberOfArguments = false;
            CaseSensitive = true;
            IncludeExpectsStringLiteral = true;
            IncludeHasOnlyFilename      = false;
            HasBinaryNot                     = true;
            MacroKeywordAfterName            = false;
            MacrosUseCheapLabelsAsParameters = false;
            LabelsMustBeAtStartOfLine        = false;
            GreaterOrLessThanAtBeginningAffectFullExpression = false;
            LoopEndHasNoScope = false;
            MessageAutoIncludesBlanksBetweenParameters = false;
            AssemblerType = Type;
            OpcodeSizeIdentifierSeparator       = "+";
            OpcodeSizeIdentifierOneByteOperands = new List <string>()
            {
                "1"
            };
            OpcodeSizeIdentifierTwoByteOperands = new List <string>()
            {
                "2"
            };

            DefaultTargetType      = Types.CompileTargetType.PRG;
            DefaultTargetExtension = ".prg";

            OperatorPrecedence.Clear();
            OperatorPrecedence["-"]   = 0;
            OperatorPrecedence["+"]   = 0;
            OperatorPrecedence["/"]   = 1;
            OperatorPrecedence["*"]   = 1;
            OperatorPrecedence["%"]   = 1;
            OperatorPrecedence["EOR"] = 3;
            OperatorPrecedence["eor"] = 3;
            OperatorPrecedence["XOR"] = 3;
            OperatorPrecedence["xor"] = 3;
            OperatorPrecedence["^"]   = 6;
            OperatorPrecedence["OR"]  = 4;
            OperatorPrecedence["or"]  = 4;
            OperatorPrecedence["|"]   = 4;
            OperatorPrecedence["AND"] = 5;
            OperatorPrecedence["and"] = 5;
            OperatorPrecedence["&"]   = 5;
            OperatorPrecedence[">>"]  = 6;
            OperatorPrecedence["<<"]  = 6;
            OperatorPrecedence["<>"]  = 6;
            OperatorPrecedence[">="]  = 6;
            OperatorPrecedence["<="]  = 6;
            OperatorPrecedence["!="]  = 6;
            OperatorPrecedence["="]   = 6;
            OperatorPrecedence[">"]   = 7;
            OperatorPrecedence["<"]   = 7;
            OperatorPrecedence["!"]   = 7;
            OperatorPrecedence["~"]   = 7;

            switch (Type)
            {
            case Types.AssemblerType.C64_STUDIO:
                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_GLOBAL] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÄÖÜäöü_";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]   = "#";

                OpenBracketChars  = "(" + INTERNAL_OPENING_BRACE + SQUARE_BRACKETS_OPEN;
                CloseBracketChars = ")" + INTERNAL_CLOSING_BRACE + SQUARE_BRACKETS_CLOSE;

                LineSeparatorChars = ":";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_LOCAL]       = ".";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_LOCAL]            = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LABEL_LOCAL]         = "#";
                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_CHEAP_LOCAL] = "@";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_CHEAP_LOCAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LABEL_CHEAP_LOCAL]   = "#";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_CHAR] = "'";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_CHAR]   = "'";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_STRING] = "\"";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_STRING]   = "\"";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_NUMBER] = "0123456789abcdefABCDEF$%";
                AllowedTokenChars[Types.TokenInfo.TokenType.LITERAL_NUMBER]      = "0123456789abcdefABCDEFx";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.COMMENT] = ";";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.PSEUDO_OP] = "!";
                AllowedTokenChars[Types.TokenInfo.TokenType.PSEUDO_OP]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_INTERNAL] = "+-";

                AllowedSingleTokens = ",#{}*?" + OpenBracketChars + CloseBracketChars;

                AddPseudoOp("!ADDR", Types.MacroInfo.PseudoOpType.ADDRESS);
                AddPseudoOp("!ADDRESS", Types.MacroInfo.PseudoOpType.ADDRESS);
                AddPseudoOp("!BYTE", Types.MacroInfo.PseudoOpType.BYTE);
                AddPseudoOp("!BY", Types.MacroInfo.PseudoOpType.BYTE);
                AddPseudoOp("!BASIC", Types.MacroInfo.PseudoOpType.BASIC);
                AddPseudoOp("!8", Types.MacroInfo.PseudoOpType.BYTE);
                AddPseudoOp("!08", Types.MacroInfo.PseudoOpType.BYTE);
                AddPseudoOp("!WORD", Types.MacroInfo.PseudoOpType.WORD);
                AddPseudoOp("!WO", Types.MacroInfo.PseudoOpType.WORD);
                AddPseudoOp("!16", Types.MacroInfo.PseudoOpType.WORD);
                AddPseudoOp("!LE16", Types.MacroInfo.PseudoOpType.WORD);
                AddPseudoOp("!BE16", Types.MacroInfo.PseudoOpType.WORD_BE);
                AddPseudoOp("!DWORD", Types.MacroInfo.PseudoOpType.DWORD);
                AddPseudoOp("!32", Types.MacroInfo.PseudoOpType.DWORD);
                AddPseudoOp("!LE32", Types.MacroInfo.PseudoOpType.DWORD);
                AddPseudoOp("!BE32", Types.MacroInfo.PseudoOpType.DWORD_BE);
                AddPseudoOp("!TEXT", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("!TX", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("!SCR", Types.MacroInfo.PseudoOpType.TEXT_SCREEN);
                AddPseudoOp("!PET", Types.MacroInfo.PseudoOpType.TEXT_PET);
                AddPseudoOp("!RAW", Types.MacroInfo.PseudoOpType.TEXT_RAW);
                AddPseudoOp("!PSEUDOPC", Types.MacroInfo.PseudoOpType.PSEUDO_PC);
                AddPseudoOp("!REALPC", Types.MacroInfo.PseudoOpType.REAL_PC);
                AddPseudoOp("!BANK", Types.MacroInfo.PseudoOpType.BANK);
                AddPseudoOp("!CONVTAB", Types.MacroInfo.PseudoOpType.CONVERSION_TAB);
                AddPseudoOp("!CT", Types.MacroInfo.PseudoOpType.CONVERSION_TAB);
                AddPseudoOp("!BINARY", Types.MacroInfo.PseudoOpType.INCLUDE_BINARY);
                AddPseudoOp("!BIN", Types.MacroInfo.PseudoOpType.INCLUDE_BINARY);
                AddPseudoOp("!BI", Types.MacroInfo.PseudoOpType.INCLUDE_BINARY);
                AddPseudoOp("!SOURCE", Types.MacroInfo.PseudoOpType.INCLUDE_SOURCE);
                AddPseudoOp("!SRC", Types.MacroInfo.PseudoOpType.INCLUDE_SOURCE);
                AddPseudoOp("!TO", Types.MacroInfo.PseudoOpType.COMPILE_TARGET);
                AddPseudoOp("!ZONE", Types.MacroInfo.PseudoOpType.ZONE);
                AddPseudoOp("!ZN", Types.MacroInfo.PseudoOpType.ZONE);
                AddPseudoOp("!ERROR", Types.MacroInfo.PseudoOpType.ERROR);
                AddPseudoOp("!SERIOUS", Types.MacroInfo.PseudoOpType.ERROR);
                AddPseudoOp("!WARN", Types.MacroInfo.PseudoOpType.WARN);
                AddPseudoOp("!MESSAGE", Types.MacroInfo.PseudoOpType.MESSAGE);
                AddPseudoOp("!IFDEF", Types.MacroInfo.PseudoOpType.IFDEF);
                AddPseudoOp("!IFNDEF", Types.MacroInfo.PseudoOpType.IFNDEF);
                AddPseudoOp("!IF", Types.MacroInfo.PseudoOpType.IF);
                AddPseudoOp("!FILL", Types.MacroInfo.PseudoOpType.FILL);
                AddPseudoOp("!FI", Types.MacroInfo.PseudoOpType.FILL);
                AddPseudoOp("!ALIGN", Types.MacroInfo.PseudoOpType.ALIGN);
                AddPseudoOp("!REALIGN", Types.MacroInfo.PseudoOpType.ALIGN_DASM);
                AddPseudoOp("!ENDOFFILE", Types.MacroInfo.PseudoOpType.END_OF_FILE);
                AddPseudoOp("!EOF", Types.MacroInfo.PseudoOpType.END_OF_FILE);
                AddPseudoOp("!NOWARN", Types.MacroInfo.PseudoOpType.NO_WARNING);
                AddPseudoOp("!FOR", Types.MacroInfo.PseudoOpType.FOR);
                AddPseudoOp("!END", Types.MacroInfo.PseudoOpType.END);
                AddPseudoOp("!MACRO", Types.MacroInfo.PseudoOpType.MACRO);
                AddPseudoOp("!TRACE", Types.MacroInfo.PseudoOpType.TRACE);
                AddPseudoOp("!MEDIA", Types.MacroInfo.PseudoOpType.INCLUDE_MEDIA);
                AddPseudoOp("!MEDIASRC", Types.MacroInfo.PseudoOpType.INCLUDE_MEDIA_SOURCE);
                AddPseudoOp("!HEX", Types.MacroInfo.PseudoOpType.HEX);
                AddPseudoOp("!H", Types.MacroInfo.PseudoOpType.HEX);
                AddPseudoOp("!SL", Types.MacroInfo.PseudoOpType.LABEL_FILE);
                AddPseudoOp("!CPU", Types.MacroInfo.PseudoOpType.CPU);
                AddPseudoOp("!SET", Types.MacroInfo.PseudoOpType.SET);

                // helper pseudo ops from ACME to generate some address vs. value warnings
                //AddMacro( "!ADDR", Types.MacroInfo.MacroType.IGNORE );
                //AddMacro( "!ADDRESS", Types.MacroInfo.MacroType.IGNORE );

                POPrefix = "!";
                MacroFunctionCallPrefix.Add("+");
                GlobalLabelsAutoZone = false;
                DefineSeparatorKeywords.Add("=");
                IncludeExpectsStringLiteral = true;
                StatementSeparatorChars.Add(':');
                break;

            case Types.AssemblerType.DASM:
                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_GLOBAL] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÄÖÜäöü_";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]   = "#:";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_LOCAL] = ".";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_LOCAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";

                OpenBracketChars  = "(" + INTERNAL_OPENING_BRACE;
                CloseBracketChars = ")" + INTERNAL_CLOSING_BRACE;

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_CHAR] = "'";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_CHAR]   = "'";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_STRING] = "\"";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_STRING]   = "\"";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_NUMBER] = "0123456789abcdefABCDEF$%";
                AllowedTokenChars[Types.TokenInfo.TokenType.LITERAL_NUMBER]      = "0123456789abcdefABCDEFx";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.COMMENT] = ";";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.PSEUDO_OP] = "!";
                AllowedTokenChars[Types.TokenInfo.TokenType.PSEUDO_OP]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.CALL_MACRO] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß";
                AllowedTokenChars[Types.TokenInfo.TokenType.CALL_MACRO]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";

                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_INTERNAL] = "+-";

                AllowedSingleTokens = ",#*" + OpenBracketChars + CloseBracketChars + "\\{}[]";

                AddPseudoOp("DC.B", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("DC.W", Types.MacroInfo.PseudoOpType.WORD);
                AddPseudoOp(".WORD", Types.MacroInfo.PseudoOpType.WORD);
                AddPseudoOp(".BYTE", Types.MacroInfo.PseudoOpType.BYTE);
                AddPseudoOp("MACRO", Types.MacroInfo.PseudoOpType.MACRO);
                AddPseudoOp("MAC", Types.MacroInfo.PseudoOpType.MACRO);
                AddPseudoOp("ENDM", Types.MacroInfo.PseudoOpType.END);
                AddPseudoOp("RORG", Types.MacroInfo.PseudoOpType.PSEUDO_PC);
                AddPseudoOp("REND", Types.MacroInfo.PseudoOpType.REAL_PC);
                AddPseudoOp("INCBIN", Types.MacroInfo.PseudoOpType.INCLUDE_BINARY);
                AddPseudoOp("INCLUDE", Types.MacroInfo.PseudoOpType.INCLUDE_SOURCE);
                AddPseudoOp("SUBROUTINE", Types.MacroInfo.PseudoOpType.ZONE);
                AddPseudoOp("ERR", Types.MacroInfo.PseudoOpType.ERROR);
                AddPseudoOp("IFCONST", Types.MacroInfo.PseudoOpType.IFDEF);
                AddPseudoOp("IFNCONST", Types.MacroInfo.PseudoOpType.IFNDEF);
                AddPseudoOp("IF", Types.MacroInfo.PseudoOpType.IF);
                AddPseudoOp("ELSE", Types.MacroInfo.PseudoOpType.ELSE);
                AddPseudoOp("ENDIF", Types.MacroInfo.PseudoOpType.END_IF);
                AddPseudoOp("DS.Z", Types.MacroInfo.PseudoOpType.FILL);
                AddPseudoOp("DS", Types.MacroInfo.PseudoOpType.FILL);
                AddPseudoOp("DS.B", Types.MacroInfo.PseudoOpType.FILL);
                AddPseudoOp("ALIGN", Types.MacroInfo.PseudoOpType.ALIGN_DASM);
                AddPseudoOp("ECHO", Types.MacroInfo.PseudoOpType.MESSAGE);

                AddPseudoOp("REPEAT", Types.MacroInfo.PseudoOpType.LOOP_START);
                AddPseudoOp("REPEND", Types.MacroInfo.PseudoOpType.LOOP_END);

                AddPseudoOp("PROCESSOR", Types.MacroInfo.PseudoOpType.IGNORE);
                AddPseudoOp("ORG", Types.MacroInfo.PseudoOpType.ORG);
                AddPseudoOp("SEG", Types.MacroInfo.PseudoOpType.SEG);
                AddPseudoOp("SEG.U", Types.MacroInfo.PseudoOpType.SEG_VIRTUAL);
                AddPseudoOp("INCDIR", Types.MacroInfo.PseudoOpType.ADD_INCLUDE_SOURCE);

                RestOfLineAsSingleToken.Add(Types.MacroInfo.PseudoOpType.ADD_INCLUDE_SOURCE);

                LabelPostfix = ":";
                MacroFunctionCallPrefix.Add(":");
                GlobalLabelsAutoZone = false;
                DefineSeparatorKeywords.Add("SET");
                DefineSeparatorKeywords.Add("EQU");
                DefineSeparatorKeywords.Add("=");
                MacroIsZone = true;
                MacrosHaveVariableNumberOfArguments = true;
                IncludeExpectsStringLiteral         = false;
                IncludeHasOnlyFilename = true;
                IncludeSourceIsAlwaysUsingLibraryPathAndFile = true;
                CaseSensitive     = false;
                LoopEndHasNoScope = true;
                MessageAutoIncludesBlanksBetweenParameters = true;
                DefaultTargetType         = Types.CompileTargetType.PLAIN;
                DefaultTargetExtension    = ".bin";
                LabelsMustBeAtStartOfLine = true;

                OpcodeSizeIdentifierSeparator       = ".";
                OpcodeSizeIdentifierOneByteOperands = new List <string> ()
                {
                    "b", "d", "z"
                };
                OpcodeSizeIdentifierTwoByteOperands = new List <string>()
                {
                    "w", "wx", "wy"
                };
                break;

            case Types.AssemblerType.TASM:
                // 64tass, TASM
                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_GLOBAL] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÄÖÜäöü_";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]   = "";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_LOCAL] = "_";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_LOCAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";

                OpenBracketChars  = "(" + INTERNAL_OPENING_BRACE;
                CloseBracketChars = ")" + INTERNAL_CLOSING_BRACE;

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_CHAR] = "'";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_CHAR]   = "'";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_STRING] = "\"";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_STRING]   = "\"";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_NUMBER] = "0123456789abcdefABCDEF$%";
                AllowedTokenChars[Types.TokenInfo.TokenType.LITERAL_NUMBER]      = "0123456789abcdefABCDEFx";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.COMMENT] = ";";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.PSEUDO_OP] = "!";
                AllowedTokenChars[Types.TokenInfo.TokenType.PSEUDO_OP]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.CALL_MACRO] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß";
                AllowedTokenChars[Types.TokenInfo.TokenType.CALL_MACRO]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";

                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_INTERNAL] = "+-";

                AllowedSingleTokens = ",#*" + OpenBracketChars + CloseBracketChars + "\\{}[]";

                AddPseudoOp(".WORD", Types.MacroInfo.PseudoOpType.WORD);
                AddPseudoOp(".ADDR", Types.MacroInfo.PseudoOpType.WORD);
                AddPseudoOp(".BYTE", Types.MacroInfo.PseudoOpType.BYTE);
                AddPseudoOp(".LOGICAL", Types.MacroInfo.PseudoOpType.PSEUDO_PC);
                AddPseudoOp(".HERE", Types.MacroInfo.PseudoOpType.REAL_PC);
                AddPseudoOp(".ALIGN", Types.MacroInfo.PseudoOpType.ALIGN_DASM);
                AddPseudoOp(".MACRO", Types.MacroInfo.PseudoOpType.MACRO);
                AddPseudoOp(".ENDM", Types.MacroInfo.PseudoOpType.END);

                RestOfLineAsSingleToken.Add(Types.MacroInfo.PseudoOpType.ADD_INCLUDE_SOURCE);

                LabelPostfix = ":";
                MacroFunctionCallPrefix.Add("#");
                MacroFunctionCallPrefix.Add(".");
                GlobalLabelsAutoZone = true;
                DefineSeparatorKeywords.Add(".VAR");
                DefineSeparatorKeywords.Add("=");
                MacroIsZone = true;
                MacrosHaveVariableNumberOfArguments = true;
                CaseSensitive          = false;
                LoopEndHasNoScope      = true;
                DefaultTargetType      = Types.CompileTargetType.PLAIN;
                DefaultTargetExtension = ".bin";
                break;

            case Types.AssemblerType.PDS:
                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_GLOBAL] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÄÖÜäöü";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]   = "#";

                OpenBracketChars  = "([" + INTERNAL_OPENING_BRACE;
                CloseBracketChars = ")]" + INTERNAL_CLOSING_BRACE;

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_LOCAL] = "!:";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_LOCAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß!";

                // we misuse cheap labels as macro parameters
                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_CHEAP_LOCAL] = "@";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_CHEAP_LOCAL]      = "0123456789";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_CHAR] = "'";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_CHAR]   = "'";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_STRING] = "\"";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_STRING]   = "\"";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_NUMBER] = "0123456789abcdefABCDEF&$%";
                AllowedTokenChars[Types.TokenInfo.TokenType.LITERAL_NUMBER]      = "0123456789abcdefABCDEFx";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.COMMENT] = ";";
                AllowedTokenStartChars[Types.TokenInfo.TokenType.COMMENT_IF_FIRST_CHAR] = "*";

                AllowedTokenChars[Types.TokenInfo.TokenType.SINGLE_CHAR]      = "\\.";
                AllowedTokenStartChars[Types.TokenInfo.TokenType.SINGLE_CHAR] = "\\.";

                /*
                 * AllowedTokenStartChars[Types.TokenInfo.TokenType.MACRO] = "!";
                 * AllowedTokenChars[Types.TokenInfo.TokenType.MACRO] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
                 */

                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_INTERNAL] = "+-";

                AllowedSingleTokens = ",#*" + OpenBracketChars + CloseBracketChars;

                AddPseudoOp("DC.B", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("DC.V", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("DB", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("DEFM", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("DM", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("DFM", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("DH", Types.MacroInfo.PseudoOpType.HIGH_BYTE);
                AddPseudoOp("DL", Types.MacroInfo.PseudoOpType.LOW_BYTE);
                AddPseudoOp("DW", Types.MacroInfo.PseudoOpType.WORD);
                AddPseudoOp("HEX", Types.MacroInfo.PseudoOpType.HEX);
                AddPseudoOp("CBM", Types.MacroInfo.PseudoOpType.TEXT_SCREEN);
                AddPseudoOp("INCBIN", Types.MacroInfo.PseudoOpType.INCLUDE_BINARY);
                AddPseudoOp("INCLUDE", Types.MacroInfo.PseudoOpType.INCLUDE_SOURCE);
                AddPseudoOp("ERROR", Types.MacroInfo.PseudoOpType.ERROR);
                AddPseudoOp("IF", Types.MacroInfo.PseudoOpType.IF);
                AddPseudoOp("ENDIF", Types.MacroInfo.PseudoOpType.END_IF);
                AddPseudoOp("ELSE", Types.MacroInfo.PseudoOpType.ELSE);
                AddPseudoOp("DS", Types.MacroInfo.PseudoOpType.FILL);
                AddPseudoOp("DO", Types.MacroInfo.PseudoOpType.LOOP_START);
                AddPseudoOp("LOOP", Types.MacroInfo.PseudoOpType.LOOP_END);
                AddPseudoOp("UNTIL", Types.MacroInfo.PseudoOpType.LOOP_END);
                AddPseudoOp("MACRO", Types.MacroInfo.PseudoOpType.MACRO);
                AddPseudoOp("ENDM", Types.MacroInfo.PseudoOpType.END);

                AddPseudoOp("PROCESSOR", Types.MacroInfo.PseudoOpType.IGNORE);
                AddPseudoOp("ORG", Types.MacroInfo.PseudoOpType.ORG);
                AddPseudoOp("FREE", Types.MacroInfo.PseudoOpType.IGNORE);
                AddPseudoOp("SEND", Types.MacroInfo.PseudoOpType.IGNORE);
                AddPseudoOp("SKIP", Types.MacroInfo.PseudoOpType.IGNORE);
                AddPseudoOp("INFO", Types.MacroInfo.PseudoOpType.IGNORE);
                AddPseudoOp("RUN", Types.MacroInfo.PseudoOpType.IGNORE);

                AddPseudoOp("EXEC", Types.MacroInfo.PseudoOpType.IGNORE);
                AddPseudoOp("START", Types.MacroInfo.PseudoOpType.IGNORE);

                AddPseudoOp("DSECT", Types.MacroInfo.PseudoOpType.IGNORE);
                AddPseudoOp("DEND", Types.MacroInfo.PseudoOpType.IGNORE);

                AddPseudoOp("MSW", Types.MacroInfo.PseudoOpType.IGNORE);

                AddPseudoOp("END", Types.MacroInfo.PseudoOpType.END_OF_FILE);
                AddPseudoOp("REPEAT", Types.MacroInfo.PseudoOpType.REPEAT);

                OperatorPrecedence["!"] = 4;

                LabelPostfix         = ":";
                GlobalLabelsAutoZone = true;
                DefineSeparatorKeywords.Add("EQU");
                DefineSeparatorKeywords.Add("=");
                CaseSensitive = false;
                IncludeExpectsStringLiteral = false;
                IncludeHasOnlyFilename      = true;
                StatementSeparatorChars.Add(':');
                MacroKeywordAfterName               = true;
                DoWithoutParameterIsUntil           = true;
                MacrosHaveVariableNumberOfArguments = true;
                MacrosUseCheapLabelsAsParameters    = true;
                HasBinaryNot = false;
                LabelsMustBeAtStartOfLine = true;
                GreaterOrLessThanAtBeginningAffectFullExpression = true;
                break;

            case Types.AssemblerType.C64ASM:
                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_GLOBAL] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÄÖÜäöü";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]   = "#";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_LOCAL] = "_";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_LOCAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";

                OpenBracketChars  = "(" + INTERNAL_OPENING_BRACE;
                CloseBracketChars = ")" + INTERNAL_CLOSING_BRACE;

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_CHAR] = "'";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_CHAR]   = "'";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_STRING] = "\"";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_STRING]   = "\"";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_NUMBER] = "0123456789abcdefABCDEF$%";
                AllowedTokenChars[Types.TokenInfo.TokenType.LITERAL_NUMBER]      = "0123456789abcdefABCDEFx";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.COMMENT] = ";";
                //AllowedTokenStartChars[Types.TokenInfo.TokenType.COMMENT_IF_FIRST_CHAR] = "*";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.PSEUDO_OP] = ".";
                AllowedTokenChars[Types.TokenInfo.TokenType.PSEUDO_OP]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_INTERNAL] = "+-";

                AllowedSingleTokens = ",#{}*" + OpenBracketChars + CloseBracketChars;

                POPrefix = ".";

                AddPseudoOp(".BYTE", Types.MacroInfo.PseudoOpType.BYTE);
                AddPseudoOp(".WORD", Types.MacroInfo.PseudoOpType.WORD);

                GlobalLabelsAutoZone = true;
                DefineSeparatorKeywords.Add("=");
                CaseSensitive = false;
                IncludeExpectsStringLiteral = true;
                break;

            case Types.AssemblerType.CBMPRGSTUDIO:
                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_GLOBAL] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyzÄÖÜäöü";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LABEL_GLOBAL]   = "#:";

                OpenBracketChars  = "(" + INTERNAL_OPENING_BRACE;
                CloseBracketChars = ")" + INTERNAL_CLOSING_BRACE;

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LABEL_LOCAL] = ".";
                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_LOCAL]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_CHAR] = "'";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_CHAR]   = "'";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_STRING] = "\"";
                AllowedTokenEndChars[Types.TokenInfo.TokenType.LITERAL_STRING]   = "\"";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.LITERAL_NUMBER] = "0123456789abcdefABCDEF$%";
                AllowedTokenChars[Types.TokenInfo.TokenType.LITERAL_NUMBER]      = "0123456789abcdefABCDEFx";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.COMMENT] = ";";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.PSEUDO_OP] = "!";
                AllowedTokenChars[Types.TokenInfo.TokenType.PSEUDO_OP]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";

                AllowedTokenStartChars[Types.TokenInfo.TokenType.CALL_MACRO] = ":";
                AllowedTokenChars[Types.TokenInfo.TokenType.CALL_MACRO]      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_äöüÄÖÜß.";

                AllowedTokenChars[Types.TokenInfo.TokenType.LABEL_INTERNAL] = "+-";

                AllowedSingleTokens = ",#*" + OpenBracketChars + CloseBracketChars;

                AddPseudoOp("DC.B", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("DC.W", Types.MacroInfo.PseudoOpType.WORD);
                AddPseudoOp("MAC", Types.MacroInfo.PseudoOpType.MACRO);
                AddPseudoOp("ENDM", Types.MacroInfo.PseudoOpType.END);
                AddPseudoOp("!TEXT", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("!TX", Types.MacroInfo.PseudoOpType.TEXT);
                AddPseudoOp("!SCR", Types.MacroInfo.PseudoOpType.TEXT_SCREEN);
                AddPseudoOp("RORG", Types.MacroInfo.PseudoOpType.PSEUDO_PC);
                AddPseudoOp("REND", Types.MacroInfo.PseudoOpType.REAL_PC);
                AddPseudoOp("!BANK", Types.MacroInfo.PseudoOpType.BANK);
                AddPseudoOp("!CONVTAB", Types.MacroInfo.PseudoOpType.CONVERSION_TAB);
                AddPseudoOp("!CT", Types.MacroInfo.PseudoOpType.CONVERSION_TAB);
                AddPseudoOp("INCBIN", Types.MacroInfo.PseudoOpType.INCLUDE_BINARY);
                AddPseudoOp("INCLUDE", Types.MacroInfo.PseudoOpType.INCLUDE_SOURCE);
                AddPseudoOp("!TO", Types.MacroInfo.PseudoOpType.COMPILE_TARGET);
                AddPseudoOp("SUBROUTINE", Types.MacroInfo.PseudoOpType.ZONE);
                AddPseudoOp("!ERROR", Types.MacroInfo.PseudoOpType.ERROR);
                AddPseudoOp("!IFDEF", Types.MacroInfo.PseudoOpType.IFDEF);
                AddPseudoOp("!IFNDEF", Types.MacroInfo.PseudoOpType.IFNDEF);
                AddPseudoOp("IF", Types.MacroInfo.PseudoOpType.IF);
                AddPseudoOp("ELSE", Types.MacroInfo.PseudoOpType.ELSE);
                AddPseudoOp("ENDIF", Types.MacroInfo.PseudoOpType.END_IF);
                AddPseudoOp("DS.Z", Types.MacroInfo.PseudoOpType.FILL);
                AddPseudoOp("DS", Types.MacroInfo.PseudoOpType.FILL);
                AddPseudoOp("DS.B", Types.MacroInfo.PseudoOpType.FILL);
                AddPseudoOp("ALIGN", Types.MacroInfo.PseudoOpType.ALIGN_DASM);
                AddPseudoOp("!ENDOFFILE", Types.MacroInfo.PseudoOpType.END_OF_FILE);

                AddPseudoOp("REPEAT", Types.MacroInfo.PseudoOpType.LOOP_START);
                AddPseudoOp("REPEND", Types.MacroInfo.PseudoOpType.LOOP_END);

                AddPseudoOp("PROCESSOR", Types.MacroInfo.PseudoOpType.IGNORE);
                AddPseudoOp("ORG", Types.MacroInfo.PseudoOpType.ORG);
                AddPseudoOp("SEG", Types.MacroInfo.PseudoOpType.SEG);
                AddPseudoOp("SEG.U", Types.MacroInfo.PseudoOpType.SEG);
                AddPseudoOp("BYTE", Types.MacroInfo.PseudoOpType.BYTE);

                LabelPostfix = ":";
                MacroFunctionCallPrefix.Add(":");
                GlobalLabelsAutoZone = false;
                DefineSeparatorKeywords.Add("SET");
                DefineSeparatorKeywords.Add("=");
                MacroIsZone = true;
                MacrosHaveVariableNumberOfArguments = true;
                IncludeExpectsStringLiteral         = false;
                break;
            }
        }