@Override
    public String toImplementationSyntax(TableModel model, String definition)
    {
        String newDefinition = definition;        
        StringTokenizer tokens = new StringTokenizer(newDefinition,
                getSyntax().getDelimiters());
        
        String token;
        String cellID = null;
        String fields = null;
        
        String modelName = model instanceof JeksTableModel ? ((JeksTableModel) model).name : "";
        
        while (tokens.hasMoreTokens())
        {
            token = tokens.nextToken();            
            Pattern pattern = Pattern.compile("(([^!]+)!)?([^!]+)!(.+)");
            Matcher matcher = pattern.matcher(token);
            if(matcher.matches())
            {      
                String match1 = matcher.group(2);
                String match2 = matcher.group(3);
                String match3 = matcher.group(4);
                
                if(match1 != null && state.getModel(match1) != null)
                {
                    cellID = match1 + "!"  + match2;
                    fields = match3;
                }
                else if(match1 != null)
                {
                    cellID = match1;
                    fields = match2 + "!"  + match3;
                }
                else if(state.getModel(match2) == null)
                {
                    cellID = match2;
                    fields = match3;
                }
                if(cellID != null)
                {
                    try
                    {
                        newDefinition = newDefinition.replace(token, "DEREF(\"" + modelName + "\","
                                + cellID + ",\"" + fields + "\")");
                    } catch (IndexOutOfBoundsException e)
                    {
                        // throw new CompilationException();
                    }
                }
            }
            cellID = null;
            fields = null;
        }
        return newDefinition;
    }