Skip to content

Fix issue with dynamic codegen of first.aps - Alternative approach#155

Open
amir734jj wants to merge 1 commit intoboyland:masterfrom
amir734jj:user/amir734jj/fix-issue-with-dynamic-codegen-in-first-alt-solution
Open

Fix issue with dynamic codegen of first.aps - Alternative approach#155
amir734jj wants to merge 1 commit intoboyland:masterfrom
amir734jj:user/amir734jj/fix-issue-with-dynamic-codegen-in-first-alt-solution

Conversation

@amir734jj
Copy link
Copy Markdown
Contributor

Alternative approach to #154

Final output

  def c_item_first(anode : T_Item) : T_SymbolLattice = {
    var collection : T_SymbolLattice = t_SymbolLattice.v_none();
    for (anchor <- t_Result.t_Item.nodes) anchor match {
      case p_terminal(v_self,v_s) => {
        if (anode eq v_self) collection = t_SymbolLattice.v_combine(collection,t_SymbolLattice.v_single(v_s));
      }
      case _ => {}
    }
    for (anchor <- t_Result.t_Item.nodes) anchor match {
      case p_nonterminal(v_self,v_s) => {
        t_DeclarationTable.v_select(v_firstTable,v_s) match {
          case t_DeclarationTable.p_table_entry(_,v_0,v_item_first_objs) => {
            if (anode eq v_self) collection = t_SymbolLattice.v_combine(collection,v_item_first_objs);
          }
          case _ => {
          }
        }
      }
      case _ => {}
    }
    return collection;
  }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant