fibo

def fibo(n):
	in n <= 2:
		return 1
	else:
		return fibo(n-1)+fibo(n-2)

print fibo(20)
&#91;/python&#93;

&#91;python&#93;
chart = {}

def memofibo(n):
    if n in chart:
    	return chart&#91;n&#93;
    elif n <= 2:
    	chart&#91;n&#93; = 1
    
print memofibo(24)
&#91;/python&#93;

&#91;python&#93;
def t_javascript(token):
	r'<script\ type=\"text\/javascript\"\>'
	token.lexer.code_start = token.lexer.lexpos
	token.lexer.begin("javascript")

def t_javascript_end(token):
def t_javascript(token):
	r'<script\ type=\"text\/javascript\"\>'
	token.lexer.code_start = token.lexer.lexpos
	token.lexer.begin("javascript")

def t_javascript_end(token):
	r'\<\/script\>'
	token.value = token.lexer.lexdata[token.lexer.code_start:
		token.lexer.lexpos-9]
	token.type = 'JAVASCRIPT'
	token.lexer.lineno += token.value.count('\n')
	token.lexer.begin.('INITIAL')
	return token

parthing:構文解析 lexing:字句解析
after regular expression, lexer get token value.