public void visit(UndefinedD undefinedD) { UndefinedV undefinedV = new UndefinedV(undefinedD, level + 1); undefinedD.References.Add(undefinedV); current = undefinedV; }
public void visit(UndefinedD undefinedD) { String value = "???"; Run run = new Run(); run.Text = value; representation.Inlines.Add(run); }
private static Lexeme Reverse(UndefinedD nont) { return new Lexeme(LexemeType.Undefined, -1); }
public void visit(UndefinedD undefinedD) { if (symbolType == SymbolType.Undefined) found = true; }
public UndefinedV(UndefinedD undefinedD, int levelIn) { reference = undefinedD; level = levelIn; }
/// <summary> /// Returns the rule structure, without the ChoiceLineD /// </summary> /// <param name="productionRuleLexemes"></param> /// <returns></returns> private void CreateRuleDataStructure(List<Lexeme> productionRuleLexemes, ChoiceLineD choiceLineD) { //GrammarNodeD returnVal; OperationD current = choiceLineD; // points to which level we are at //returnVal = current; // Split by Choice as this has the highest precedence List<Lexeme> choiceLexemes = new List<Lexeme>(); ArrayList choices = new ArrayList(); foreach (Lexeme lexeme in productionRuleLexemes) { if (lexeme.Type == LexemeType.Choice) { choices.Add(choiceLexemes); choiceLexemes = new List<Lexeme>(); } else { choiceLexemes.Add(lexeme); } } // add last choice list choices.Add(choiceLexemes); // put in a choiceD ChoiceD choiceD = new ChoiceD(current); current.appendChild(choiceD); current = choiceD; // move down a level // add the concatenated items for each Choice foreach (List<Lexeme> concatLexemes in choices) { ConcatenationD concatenation = new ConcatenationD(current); foreach (Lexeme lexeme in concatLexemes) { if (lexeme.Type == LexemeType.Nonterminal) { // create nonterminal tail from the nonterminalhead NonterminalHeadD nontHead = getNonterminalHead(lexeme.Value); if (nontHead == null) throw new Exception("Could not find a defined rule for the Nonterminal: " + lexeme.Value); NonterminalTailD nontTail = new NonterminalTailD(nontHead, concatenation); // add the tail to current children concatenation.appendChild(nontTail); } else if (lexeme.Type == LexemeType.Terminal) { TerminalD terminalD = new TerminalD(lexeme.Value, concatenation); concatenation.appendChild(terminalD); } else if (lexeme.Type == LexemeType.Undefined) { UndefinedD undefinedD = new UndefinedD(concatenation); concatenation.appendChild(undefinedD); } else if (lexeme.Type != LexemeType.Concatenation) { // Lexes should only be of type Nont, T and Concat. Error throw new Exception("Lexeme was not of type Nonterminal, Terminal or Concatenation"); } } current.appendChild(concatenation); } }
private void createItem(GrammarNodeD parent) { GrammarNodeD newItem; switch (symbolType) { case VADG.Global.SymbolType.Undefined: newItem = new UndefinedD(parent); break; default: throw new Exception("The visitor does not support that type yet, get on it!"); } item = newItem; }
public void visit(UndefinedD undefinedD) { }
public void visit(UndefinedD undefinedD) { String value = "???"; representation += value; }
public void visit(UndefinedD undefinedD) { undefinedD.IsSelected = false; }