I’m writing a CODEA project I call “CODEA Enlightenment”
With it, you will be able to “Display, Understand, Add Documentation and Edit CODEA Projects.”
My goal is to understand existing CODEA source code even on small iPhone 6+ screens.
My method is to create a second CODEA project recording what I have learned but without duplicating the original code.
I am coding tokenizers and parsers to extract all class and function definitions and display their relationships graphically at any zoom level with minimal human work.
Once the information is extracted, you can manipulate it for your best Enlightenment.
What you do will be stored in the second CODEA project for recall at your next session.
I’m currently using the CargoBot example as a test case because it has a very sophisticated class structure and is available to everyone.
Photo shows one box per tab giving lines containing “class(”
Can show lines containing "function " and “{”(for tables but overflows screen for Carbo-Bot.
Next step extract class names and graph class structure
But first extracting tokens from one line of code.
@CodingOnNapkins — Sounds like a big project. This would be very helpful if you make it. I would suggest creating a repository on GitHub for the code while the project is still in progress, so people can help you easily.
i am very imaptient to see this working!
That would help a lot, i though about doing something similar but that is too large for my shoulders. However, when you publish the code i may help on improving it (if needed).
To everyone, show me what you would like to see by putting sample layouts here.
Now that I have learned about pasteboard.copy(), I can show CODEA Enlightenment output by putting output into strings since the screen shots didn’t work.
Oh, by the way, if you turn on assistive touch in settings>general>accessibility>assistive touch a little dot in a square appears on screen. Tap it, then Device then “… More” then Screenshot to get screen photo without all the holding down two buttons stuff. And you can lock the screen without using any physical buttons! You can move the assistive touch button anywhere on the edge of the screen to get it out of the way of another touch area.
Here’s something I had. I didn’t have a use for it so I never really finished it. It may contain bugs. It’s set up for Cargo-Bot.
EDIT: It may take awhile for Cargo-Bot. You can scroll the text up or down.
displayMode(FULLSCREEN)
function setup()
font("Courier")
project="Cargo-Bot" -- change project name to what you want
textMode(CORNER)
dy=0
tab={}
r=listProjectTabs(project)
for a,b in pairs(r) do
str=readProjectTab(project..":"..b)
table.insert(tab,"\
")
table.insert(tab,"\
")
table.insert(tab,project.." : "..b)
b1=1
s=1
comment=false
startComment=false
while true do
s,e=string.find(str,"\
",s)
if s==nil then
break
end
s=e+1
str1=string.sub(str,b1,e)
s1,e1=string.find(str1,"%-%-%[%[")
if s1 ~= nil then
startComment=true
end
s1,e1=string.find(str1,"%-%-%]%]")
if s1 ~= nil then
startComment=false
end
comment=false
s1,e1=string.find(str1,"%-%-")
if s1 ~= nil then
comment=true
end
process=true
if comment or startComment then
process=false
end
if process then
s1,e1=string.find(str1,"class")
if s1~=nil then
s2,e2=string.find(str1,")")
if s2~= nil then
table.insert(tab," "..string.sub(str1,1,e2))
b1=e2+1
end
else
s2,e2=string.find(str1,"function")
if s2~=nil and s2==1 then
s3,e3=string.find(str1,")")
if s3~= nil then
table.insert(tab," "..string.sub(str1,1,e3))
b1=e3+1
end
end
end
if s==nil then
break
end
end
if e~=nil then
b1=e+1
end
end
end
table.insert(tab,"\
")
table.insert(tab,"\
")
table.insert(tab,"END of "..project)
end
function draw()
background(40, 40, 50)
fill(255)
for a,b in pairs(tab) do
text(b,100,HEIGHT-a*20+dy)
end
end
function touched(t)
if t.state==BEGAN or t.state==MOVING then
dy=dy+t.deltaY
if dy<0 then
dy=0
end
end
end