- Timestamp:
- 07/19/13 00:31:12 (11 years ago)
- Location:
- branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/CodeEditor.xaml.cs
r9674 r9724 57 57 } 58 58 59 private void textEditor_MouseWheel(object sender, System.Windows.Input.MouseWheelEventArgs e) {59 private void textEditor_MouseWheel(object sender, MouseWheelEventArgs e) { 60 60 } 61 61 62 private void textEditor_KeyDown(object sender, System.Windows.Input.KeyEventArgs e) {62 private void textEditor_KeyDown(object sender, KeyEventArgs e) { 63 63 if (e.Key == Key.LeftCtrl || e.Key == Key.RightCtrl) controlHeld = true; 64 64 } … … 70 70 internal void SetLexError(string msg, int line, int col) { 71 71 errorLineTransformer.MarkLexError(msg, line, col); 72 textEditor. InvalidateVisual();72 textEditor.TextArea.TextView.Redraw(); 73 73 } 74 74 75 75 internal void SetSynError(string msg, int line, int col) { 76 76 errorLineTransformer.MarkSynError(msg, line, col); 77 textEditor. InvalidateVisual();77 textEditor.TextArea.TextView.Redraw(); 78 78 } 79 79 80 80 internal void ClearErrors() { 81 81 errorLineTransformer.ClearErrors(); 82 textEditor. InvalidateVisual();82 textEditor.TextArea.TextView.Redraw(); 83 83 } 84 84 -
branches/HeuristicLab.Problems.GPDL/HeuristicLab.Problems.GPDL.Views/3.4/GpdlEditor.cs
r9674 r9724 2 2 using System.IO; 3 3 using System.Linq; 4 using System.Text; 4 5 using HeuristicLab.MainForm.WindowsForms; 5 6 using HeuristicLab.Problems.Instances; … … 19 20 20 21 private void compileButton_Click(object sender, EventArgs e) { 21 Utils.InstallModule("Utils", Utils.UtilsMethod);22 Utils.InstallModule("Sets", Sets.SetsMethod);23 Utils.InstallModule("Errors", Errors.ErrorsMethod);22 //Utils.InstallModule("Utils", Utils.UtilsMethod); 23 //Utils.InstallModule("Sets", Sets.SetsMethod); 24 //Utils.InstallModule("Errors", Errors.ErrorsMethod); 24 25 25 Utils.InstallModule("GPDefLex", GPDefLex.GPDefLexMethod);26 Utils.InstallModule("GPDefSem", GPDefSem.GPDefSemMethod);27 Utils.InstallModule("GPDefSyn", GPDefSyn.GPDefSynMethod);26 //Utils.InstallModule("GPDefLex", GPDefLex.GPDefLexMethod); 27 //Utils.InstallModule("GPDefSem", GPDefSem.GPDefSemMethod); 28 //Utils.InstallModule("GPDefSyn", GPDefSyn.GPDefSynMethod); 28 29 29 // --- initialize modules ---30 Utils.Modules(Utils.ModuleAction.initModule);30 //// --- initialize modules --- 31 //Utils.Modules(Utils.ModuleAction.initModule); 31 32 32 Errors.PushAbortMethod(new Errors.AbortMethod(Abort));33 //Errors.PushAbortMethod(new Errors.AbortMethod(Abort)); 33 34 34 using (var src = new StringReader(codeEditor.textEditor.Text)) { 35 GPDefLex.src = src; 36 GPDefSyn.Parse(); 35 using (var src = new MemoryStream(Encoding.UTF8.GetBytes(codeEditor.textEditor.Text))) { 36 Scanner scanner = new Scanner(src); 37 Parser parser = new Parser(scanner); 38 parser.Parse(); 37 39 } 38 40 39 41 codeEditor.ClearErrors(); 40 42 41 if (Errors.NumOfErrors() == 0) {42 GPDefLex.InitLex();43 GPDefSyn.Interpret();43 //if (Errors.NumOfErrors() == 0) { 44 // GPDefLex.InitLex(); 45 // GPDefSyn.Interpret(); 44 46 45 MainForm.MainFormManager.MainForm.ShowContent(GPDefSem.problem);46 } else {47 int nLexErrors = Errors.NumOfLexErrors();48 for (int i = 0; i < nLexErrors; i++) {49 var lexErr = Errors.GetLexError(i == 0);50 codeEditor.SetLexError(lexErr.msg, lexErr.line, lexErr.col);51 }52 int nSynErrors = Errors.NumOfSynErrors();53 for (int i = 0; i < nSynErrors; i++) {54 var synErr = Errors.GetSynError(i == 0);55 codeEditor.SetLexError(synErr.msg, synErr.line, synErr.col);56 }57 }47 // MainForm.MainFormManager.MainForm.ShowContent(GPDefSem.problem); 48 //} else { 49 // int nLexErrors = Errors.NumOfLexErrors(); 50 // for (int i = 0; i < nLexErrors; i++) { 51 // var lexErr = Errors.GetLexError(i == 0); 52 // codeEditor.SetLexError(lexErr.msg, lexErr.line, lexErr.col); 53 // } 54 // int nSynErrors = Errors.NumOfSynErrors(); 55 // for (int i = 0; i < nSynErrors; i++) { 56 // var synErr = Errors.GetSynError(i == 0); 57 // codeEditor.SetLexError(synErr.msg, synErr.line, synErr.col); 58 // } 59 //} 58 60 } 59 61
Note: See TracChangeset
for help on using the changeset viewer.