============ Basic select ============ import javascript select "hello world" as foo, "other", "string with escaped \\ backslashes \" quotes \n\r\t whitespace", 1234, 1234.4321, true, false --- (ql (moduleMember (imprt (import) (importModuleExpr (qualModuleExpr (simpleId))))) (moduleMember (select (asExprs (asExpr (literal (string)) (as) (varName (simpleId))) (asExpr (literal (string))) (asExpr (literal (string))) (asExpr (literal (integer))) (asExpr (literal (float))) (asExpr (literal (bool (true)))) (asExpr (literal (bool (false)))))))) ============ Select with variables and order by ============ from Foo foo, some::submodule::Bar bar, @dbtype bar, boolean b, date d, float f, int i, string s select "hello world" order by foo, bar desc, baz asc --- (ql (moduleMember (select (varDecl (typeExpr (className)) (varName (simpleId))) (varDecl (typeExpr (moduleExpr (moduleExpr (simpleId)) (simpleId)) (className)) (varName (simpleId))) (varDecl (typeExpr (typeLiteral (dbtype))) (varName (simpleId))) (varDecl (typeExpr (typeLiteral (boolean))) (varName (simpleId))) (varDecl (typeExpr (typeLiteral (date))) (varName (simpleId))) (varDecl (typeExpr (typeLiteral)) (varName (simpleId))) (varDecl (typeExpr (typeLiteral)) (varName (simpleId))) (varDecl (typeExpr (typeLiteral)) (varName (simpleId))) (asExprs (asExpr (literal (string)))) (orderBys (orderBy (variable (varName (simpleId)))) (orderBy (variable (varName (simpleId))) (direction (desc))) (orderBy (variable (varName (simpleId))) (direction (asc))))))) ======================== Annotations and comments ======================== private import foo // some other comment /* * Some comment */ pragma[noinline] bindingset[foobar, this] import bar --- (ql (moduleMember (annotation (annotName)) (imprt (import) (importModuleExpr (qualModuleExpr (simpleId))))) (line_comment) (block_comment) (moduleMember (annotation (annotName) (annotArg (simpleId))) (annotation (annotName) (annotArg (simpleId)) (annotArg (this))) (imprt (import) (importModuleExpr (qualModuleExpr (simpleId))))))