Answer:
Depends on the legal system they operate in. Judges cannot legislate since they are part of a different branch of power (judiciary, not legislature). However, Courts decisions are part of the legislature in common law countries, whereas they are not in civil law countries.