Encode strings into AST